GameKit  0.0.1a
C++ gamedev tools
Public Member Functions | Protected Attributes | Private Attributes | List of all members
gk::View Class Reference

2D view that defines what is shown on screen More...

#include <View.hpp>

Inheritance diagram for gk::View:
gk::Camera

Public Member Functions

 View ()
 
 View (const Vector3f &center, const Vector2f &size)
 
 View (const FloatRect &rectangle)
 
virtual ~View ()=default
 
void setCenter (float x, float y, float z=0)
 
void setCenter (const Vector3f &position)
 
void setSize (float width, float height)
 
void setSize (const Vector2f &size)
 
void setRotation (float angle)
 
void setViewport (const FloatRect &viewport)
 
void reset (const FloatRect &rectangle)
 
const Vector3fgetCenter () const
 
const Vector2fgetSize () const
 
float getRotation () const
 
const FloatRectgetViewport () const
 
void move (float offsetX, float offsetY, float offsetZ=0)
 
void move (const Vector3f &offset)
 
void rotate (float angle)
 
void zoom (float factor)
 
virtual const TransformgetTransform () const
 
virtual const TransformgetViewTransform () const
 
virtual const Vector3fgetPosition () const
 

Protected Attributes

bool m_transformUpdated = false
 
bool m_viewTransformUpdated = false
 
Transform m_transform
 
Transform m_viewTransform
 

Private Attributes

Vector3f m_position
 
Vector2f m_size
 
float m_rotation = 0.0f
 
FloatRect m_viewport {0, 0, 1, 1}
 

Detailed Description

2D view that defines what is shown on screen

Code inspired by SFML

Definition at line 29 of file View.hpp.

Constructor & Destructor Documentation

§ View() [1/3]

gk::View::View ( )

Definition at line 23 of file View.cpp.

§ View() [2/3]

gk::View::View ( const Vector3f center,
const Vector2f size 
)

Definition at line 27 of file View.cpp.

§ View() [3/3]

gk::View::View ( const FloatRect rectangle)
explicit

Definition at line 31 of file View.cpp.

§ ~View()

virtual gk::View::~View ( )
virtualdefault

Member Function Documentation

§ getCenter()

const Vector3f& gk::View::getCenter ( ) const
inline

Definition at line 48 of file View.hpp.

§ getPosition()

virtual const Vector3f& gk::View::getPosition ( ) const
inlinevirtual

Reimplemented in gk::Camera.

Definition at line 65 of file View.hpp.

§ getRotation()

float gk::View::getRotation ( ) const
inline

Definition at line 51 of file View.hpp.

§ getSize()

const Vector2f& gk::View::getSize ( ) const
inline

Definition at line 49 of file View.hpp.

§ getTransform()

const Transform & gk::View::getTransform ( ) const
virtual

Reimplemented in gk::Camera.

Definition at line 75 of file View.cpp.

§ getViewport()

const FloatRect& gk::View::getViewport ( ) const
inline

Definition at line 53 of file View.hpp.

§ getViewTransform()

const Transform & gk::View::getViewTransform ( ) const
virtual

Reimplemented in gk::Camera.

Definition at line 85 of file View.cpp.

§ move() [1/2]

void gk::View::move ( float  offsetX,
float  offsetY,
float  offsetZ = 0 
)

Definition at line 71 of file View.cpp.

§ move() [2/2]

void gk::View::move ( const Vector3f offset)
inline

Definition at line 56 of file View.hpp.

§ reset()

void gk::View::reset ( const FloatRect rectangle)

Definition at line 59 of file View.cpp.

§ rotate()

void gk::View::rotate ( float  angle)
inline

Definition at line 58 of file View.hpp.

§ setCenter() [1/2]

void gk::View::setCenter ( float  x,
float  y,
float  z = 0 
)

Definition at line 35 of file View.cpp.

§ setCenter() [2/2]

void gk::View::setCenter ( const Vector3f position)
inline

Definition at line 37 of file View.hpp.

§ setRotation()

void gk::View::setRotation ( float  angle)

Definition at line 51 of file View.cpp.

§ setSize() [1/2]

void gk::View::setSize ( float  width,
float  height 
)

Definition at line 43 of file View.cpp.

§ setSize() [2/2]

void gk::View::setSize ( const Vector2f size)
inline

Definition at line 40 of file View.hpp.

§ setViewport()

void gk::View::setViewport ( const FloatRect viewport)
inline

Definition at line 44 of file View.hpp.

§ zoom()

void gk::View::zoom ( float  factor)
inline

Definition at line 60 of file View.hpp.

Member Data Documentation

§ m_position

Vector3f gk::View::m_position
private

Definition at line 75 of file View.hpp.

§ m_rotation

float gk::View::m_rotation = 0.0f
private

Definition at line 78 of file View.hpp.

§ m_size

Vector2f gk::View::m_size
private

Definition at line 76 of file View.hpp.

§ m_transform

Transform gk::View::m_transform
mutableprotected

Definition at line 71 of file View.hpp.

§ m_transformUpdated

bool gk::View::m_transformUpdated = false
mutableprotected

Definition at line 68 of file View.hpp.

§ m_viewport

FloatRect gk::View::m_viewport {0, 0, 1, 1}
private

Definition at line 80 of file View.hpp.

§ m_viewTransform

Transform gk::View::m_viewTransform
mutableprotected

Definition at line 72 of file View.hpp.

§ m_viewTransformUpdated

bool gk::View::m_viewTransformUpdated = false
mutableprotected

Definition at line 69 of file View.hpp.


The documentation for this class was generated from the following files: