 |
BARE2D
|
|
Go to the documentation of this file.
12 glm::vec2
focus = glm::vec2(0.0f);
13 glm::vec2
scale = glm::vec2(1.0f);
33 void init(
float screenWidth,
float screenHeight);
91 void setScale(
float newScaleX,
float newScaleY);
98 void offsetScale(
float deltaScaleX,
float deltaScaleY);
void init(float screenWidth, float screenHeight)
Initializes the camera.
void offsetScale(float deltaScaleX, float deltaScaleY)
Adds to the zoom factor of the camera.
bool isRectInViewspace(glm::vec4 &destRect) const
glm::mat4 m_orthographicMatrix
glm::vec2 getScale() const
const glm::mat4 & getCameraMatrix() const
glm::vec2 getViewspaceCoord(glm::vec2 pos) const
Converts a coordinate from Worldspace to Viewspace.
void setFocus(glm::vec2 newFocus)
Sets the center of the camera to newFocus.
glm::vec2 getWorldspaceCoord(glm::vec2 pos) const
Converts a coordinate from Worldspace to Viewspace.
glm::vec2 getStatePosition() const
glm::vec2 getViewspaceSize(glm::vec2 size) const
Holds some basic information that the camera holds in a state.
glm::vec4 getViewspaceRect(glm::vec4 destRect) const
void offsetFocus(glm::vec2 deltaPos)
Moves the center of the camera to focus + deltaPos.
void update()
Updates the matrix if necessary.
glm::vec4 getWorldspaceRect(glm::vec4 destRect) const
glm::vec2 getViewspaceResolution() const
CameraState getLastState()
The basic camera for a 2D world. There are two spaces - the Worldspace and the Viewspace....
void setScale(float newScaleX, float newScaleY)
Sets the scale of the camera.
glm::vec2 getFocus() const
glm::vec2 getWorldspaceSize(glm::vec2 size) const