phoenix::PhView Class Reference

View class. More...

#include <PhView.h>

List of all members.

Public Member Functions

 PhView (PhRenderSystem *s, float a=0, float b=0)
 Constructor.
float getX ()
 Get X function.
float getY ()
 Get Y function.
float getRotation ()
 Get rotation.
PhVector2d getPosition ()
 Get position (vector).
float getScale ()
 Get scale.
void setX (float)
 Set X function.
void setY (float)
 Set Y function.
void setPosition (PhVector2d p)
 Set position (vector).
void setRotation (float)
 Set rotation.
void setScale (float)
 Set scale.
void setGLView ()
 Set GL view.

Protected Attributes

PhVector2d pos
 Position of the view.
float rot
 Rotation.
float scale
 Scale factor.
PhRenderSystemsystem
 Render system pointer.


Detailed Description

View class.

Simple view class that simulates a camera looking down on a 2d scene. Handles translation, rotation and scaling of the view.


Constructor & Destructor Documentation

phoenix::PhView::PhView ( PhRenderSystem s,
float  a = 0,
float  b = 0 
)

Constructor.

Parameters:
s A pointer to the phoenix::PhRenderSystem that this view will control
a X of the top-left corner of the view
b Y of the top-left corner of the view


Member Function Documentation

float phoenix::PhView::getX (  ) 

Get X function.

Returns:
Simply returns the X value of the view.

float phoenix::PhView::getY (  ) 

Get Y function.

Returns:
Simply returns the Y value of the view.

float phoenix::PhView::getRotation (  ) 

Get rotation.

Returns:
The current rotation of the view (in degrees).

PhVector2d phoenix::PhView::getPosition (  ) 

Get position (vector).

Gets the position of the current view as phoenix::PhVector2d().

Returns:
PhVector2d containing the top-left corner of the view.

float phoenix::PhView::getScale (  ) 

Get scale.

Returns:
Returns the current scale of the view.

void phoenix::PhView::setX ( float   ) 

Set X function.

Sets the X value of the top-left corner of the view.

void phoenix::PhView::setY ( float   ) 

Set Y function.

Sets the Y value of the top-left corner of the view.

void phoenix::PhView::setPosition ( PhVector2d  p  ) 

Set position (vector).

Sets the top-left corner of the view.

Parameters:
p A phoenix::PhVector2d representing the new position.

void phoenix::PhView::setRotation ( float   ) 

Set rotation.

Sets the rotation of the view (in degrees).

void phoenix::PhView::setScale ( float   ) 

Set scale.

Sets the scale factor of the view.

void phoenix::PhView::setGLView (  ) 

Set GL view.

Does the required matrix operations in OpenGL to set the view to this. The name of this function should be changed in the future to make openGL transparent to the user.


Member Data Documentation

float phoenix::PhView::rot [protected]

Rotation.

Stores the current rotation of the view (In degrees).

float phoenix::PhView::scale [protected]

Scale factor.

Stores the current scale factor of the scene, 1 is default.

PhRenderSystem* phoenix::PhView::system [protected]

Render system pointer.

pointer to phoenix::PhRenderSystem.


The documentation for this class was generated from the following file:
Generated on Tue Nov 20 21:59:25 2007 for Phoenix by  doxygen 1.5.4