#include <PhView.h>
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. | |
PhRenderSystem * | system |
Render system pointer. |
Simple view class that simulates a camera looking down on a 2d scene. Handles translation, rotation and scaling of the view.
phoenix::PhView::PhView | ( | PhRenderSystem * | s, | |
float | a = 0 , |
|||
float | b = 0 | |||
) |
Constructor.
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 |
float phoenix::PhView::getX | ( | ) |
Get X function.
float phoenix::PhView::getY | ( | ) |
Get Y function.
float phoenix::PhView::getRotation | ( | ) |
Get rotation.
PhVector2d phoenix::PhView::getPosition | ( | ) |
Get position (vector).
Gets the position of the current view as phoenix::PhVector2d().
float phoenix::PhView::getScale | ( | ) |
Get scale.
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.
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.
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.