![]() |
PROTO::KLUDGE
0.1
Quick prototyping library for games using SDL and OpenGL.
|
Decorator class for creating easing OpenGL transformations for game objects. More...
#include <GLTransformable.hpp>
Public Member Functions | |
GLTransformable () | |
Default constructor. More... | |
virtual | ~GLTransformable () |
void | setRect (GLRect r) |
Set the bounding rectangle for the GLTransformable object. Useful for calculating origin and size definitions. More... | |
GLRect & | getRect () |
Get the current bounding rectangle of the GLTransformable object. More... | |
void | setWidth (GLfloat w) |
Convenient function for setting the width of the GLTransformable. More... | |
GLfloat & | getWidth () |
Get the width of the GLTransformable. More... | |
void | setHeight (GLfloat h) |
GLfloat & | getHeight () |
Get the height of the GLTransformable. More... | |
void | setOrigin (glm::vec2 origin) |
Set the origin of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
glm::vec2 & | getOrigin () |
Get the origin of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
void | setPosition (glm::vec2 position) |
Set the position of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
const glm::vec2 & | getPosition () |
Get the position of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
void | move (glm::vec2 offset) |
Move the GLTransformable by a constant offset value in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
void | setAngle (float angle) |
Set the angle of the GLTransformable (in degrees, NOT radians). More... | |
float | getAngle () |
Get the angle of the GLTransformable (in degrees, NOT radians). More... | |
void | rotate (float degrees) |
Rotate the GLTransformable by a constant value (in degrees, NOT radians). (in degrees, NOT radians). More... | |
void | setScale (glm::vec2 scale) |
Set the scale of the GLTransformable. More... | |
glm::vec2 | getScale () |
Get the scale of the GLTransformable. More... | |
void | scale (glm::vec2 scale) |
Scale the GLTransformable by a constant factor specified as a glm::vec2 of floats. More... | |
void | clear () |
Clear the buffers and reset the GLTransformable to an uninitialized state. More... | |
Public Attributes | |
GLTransformData | m_data |
Internal transform data for GLTransformable inherited classes. More... | |
Decorator class for creating easing OpenGL transformations for game objects.
pk::GLTransformable::GLTransformable | ( | ) |
Default constructor.
|
virtual |
void pk::GLTransformable::clear | ( | ) |
Clear the buffers and reset the GLTransformable to an uninitialized state.
|
inline |
Get the angle of the GLTransformable (in degrees, NOT radians).
|
inline |
Get the height of the GLTransformable.
|
inline |
Get the origin of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example).
|
inline |
Get the position of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example).
|
inline |
Get the current bounding rectangle of the GLTransformable object.
|
inline |
Get the scale of the GLTransformable.
|
inline |
Get the width of the GLTransformable.
|
inline |
Move the GLTransformable by a constant offset value in screen coordinates (NOT normalized coordinates such as clip coordinates for example).
glm::vec2 | offset - the offset you wish to move the GLTransformable by. |
|
inline |
Rotate the GLTransformable by a constant value (in degrees, NOT radians). (in degrees, NOT radians).
float | degrees - degrees specifying the value to rotate the GLTransformable by. |
|
inline |
Scale the GLTransformable by a constant factor specified as a glm::vec2 of floats.
glm::vec2 | scale - the factor you wish to scale the GLTransformable by. |
|
inline |
Set the angle of the GLTransformable (in degrees, NOT radians).
float | angle - degrees specifying the angle of the GLTransformable. |
|
inline |
|
inline |
Set the origin of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example).
glm::vec2 | origin - a glm::vec2 |
|
inline |
Set the position of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example).
glm::vec2 | position - a glm::vec2 |
|
inline |
Set the bounding rectangle for the GLTransformable object. Useful for calculating origin and size definitions.
GLRect | r - a bounding rectangle for the GLTransformable object. |
|
inline |
Set the scale of the GLTransformable.
glm::vec2 | scale - the scale you wish to assign to the GLTransformable. |
|
inline |
Convenient function for setting the width of the GLTransformable.
GLfloat | w - width of the GLTransformable. |
GLTransformData pk::GLTransformable::m_data |
Internal transform data for GLTransformable inherited classes.