OrthoCamera Class Reference
[Cameras]

2D orthographic camera class. More...

#include <OrthoCamera.h>

Inheritance diagram for OrthoCamera:

Inheritance graph
[legend]
Collaboration diagram for OrthoCamera:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

2D orthographic camera class.

The OrthoCamera class provides a simple 2D orthographic camera.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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


Member Function Documentation

void OrthoCamera::setViewingRange ( float  x,
float  y,
float  w,
float  h 
) [inline]

Sets the viewable range for this camera.

Parameters:
x lower left viewing corner x location
y lower left viewing corner y location
w view width
h view height

Vector2f OrthoCamera::worldToObject ( const Vector2f world  )  const [inline, virtual]

Returns object space coordinates of the given world space point.

See also:
Vector2f
Parameters:
world a point in world space
Returns:
the object space coordinates of world

Reimplemented from Node.

Vector2f OrthoCamera::objectToWorld ( const Vector2f object  )  const [inline, virtual]

Returns world space coordinates of the given object space point.

See also:
Vector2f
Parameters:
object a point in object space
Returns:
the world space coordinates of object

Reimplemented from Node.

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.

Parameters:
w window width
h window height

Implements Camera.


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

Generated on Fri Feb 22 15:56:22 2008 for Scene2D by  doxygen 1.5.5