#include <OrthoCamera.h>
Public Member Functions | |
OrthoCamera (int w, int h) | |
Constructs a new OrthoCamera. | |
OrthoCamera (const std::string &name, int w, int h) | |
Constructs a new named OrthoCamera. | |
OrthoCamera (int windowWidth, int windowHeight, float camX, float camY, float viewWidth, float viewHeight) | |
Constructs a new OrthoCamera with specific viewing parameters. | |
OrthoCamera (const std::string &name, int windowWidth, int windowHeight, float camX, float camY, float viewWidth, float viewHeight) | |
Constructs a new named OrthoCamera with specific viewing parameters. | |
void | setViewingRange (float x, float y, float w, float h) |
Sets the viewable range for this camera. | |
Vector2f | worldToObject (const Vector2f &world) const |
Returns object space coordinates of the given world space point. | |
Vector2f | objectToWorld (const Vector2f &object) const |
Returns world space coordinates of the given object space point. | |
Protected Member Functions | |
void | camera_resize (int w, int h) |
Resets the orthographic projection for the newly resized view. |
The OrthoCamera class provides a simple 2D orthographic camera.
OrthoCamera::OrthoCamera | ( | int | w, | |
int | h | |||
) | [inline] |
Constructs a new OrthoCamera.
Requires the width and height of the window. The default viewing range will be set to start at 0,0 in the lower left corner and extend to w,h at the upper right corner.
w | window width | |
h | window height |
OrthoCamera::OrthoCamera | ( | const std::string & | name, | |
int | w, | |||
int | h | |||
) | [inline] |
Constructs a new named OrthoCamera.
Requires the width and height of the window. The default viewing range will be set to start at 0,0 in the lower left corner and extend to w,h at the upper right corner.
name | name of this Node | |
w | window width | |
h | window height |
OrthoCamera::OrthoCamera | ( | int | windowWidth, | |
int | windowHeight, | |||
float | camX, | |||
float | camY, | |||
float | viewWidth, | |||
float | viewHeight | |||
) | [inline] |
Constructs a new OrthoCamera with specific viewing parameters.
Requires the width and height of the window.
windowWidth | window width | |
windowHeight | window height | |
camX | lower left viewing corner x location | |
camY | lower left viewing corner y location | |
viewWidth | view width | |
viewHeight | view height |
OrthoCamera::OrthoCamera | ( | const std::string & | name, | |
int | windowWidth, | |||
int | windowHeight, | |||
float | camX, | |||
float | camY, | |||
float | viewWidth, | |||
float | viewHeight | |||
) | [inline] |
Constructs a new named OrthoCamera with specific viewing parameters.
Requires the width and height of the window.
name | name of this Node | |
windowWidth | window width | |
windowHeight | window height | |
camX | lower left viewing corner x location | |
camY | lower left viewing corner y location | |
viewWidth | view width | |
viewHeight | view height |
void OrthoCamera::setViewingRange | ( | float | x, | |
float | y, | |||
float | w, | |||
float | h | |||
) | [inline] |
Sets the viewable range for this camera.
x | lower left viewing corner x location | |
y | lower left viewing corner y location | |
w | view width | |
h | view height |
void OrthoCamera::camera_resize | ( | int | w, | |
int | h | |||
) | [inline, protected, virtual] |
Resets the orthographic projection for the newly resized view.
This should always be called through the Camera::resizeView(int,int) method.
w | window width | |
h | window height |
Implements Camera.