PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
pk::Transform Class Reference

Transform used to manipulate the position, scale, center, and rotation of objects. More...

#include <Transform.hpp>

Collaboration diagram for pk::Transform:
Collaboration graph

Public Member Functions

 Transform ()
 Default constructor. More...
 
virtual ~Transform ()
 
void setTransformData (transformData &t)
 Set the transform data for the transformable object. More...
 
const transformDatagetTransformData ()
 Get the current transform data for the transformable. More...
 
void setCenter (glm::vec2 &point)
 Set the center point for the transformable object. More...
 
const glm::vec2 & getCenter ()
 Get the current center point of the transformable. More...
 
void setAngle (float angle)
 Set the angle for the transformable (in degrees). More...
 
float getAngle ()
 Get the current angle of the transformable object (in degrees). More...
 
void setPosition (glm::vec2 position)
 Set the position of the transformable in the Window. More...
 
glm::vec2 getPosition ()
 Get the current position of the transformable. More...
 

Private Attributes

transformData m_data
 The raw transform data. More...
 

Detailed Description

Transform used to manipulate the position, scale, center, and rotation of objects.

Constructor & Destructor Documentation

◆ Transform()

pk::Transform::Transform ( )

Default constructor.

◆ ~Transform()

virtual pk::Transform::~Transform ( )
virtual

Member Function Documentation

◆ getAngle()

float pk::Transform::getAngle ( )
inline

Get the current angle of the transformable object (in degrees).

Returns
float - a plain float corresponding to an angle (in degrees).

◆ getCenter()

glm::vec2 *const pk::Transform::getCenter ( )
inline

Get the current center point of the transformable.

Returns
glm::vec2 - a glm::vec2 corresponding to the current center point of the transformable.

◆ getPosition()

glm::vec2 pk::Transform::getPosition ( )
inline

Get the current position of the transformable.

Returns
glm::vec2 - a glm::vec2 corresponding to a position.

◆ getTransformData()

const transformData & pk::Transform::getTransformData ( )
inline

Get the current transform data for the transformable.

Returns
const transformData & - transform data for the transformable.

◆ setAngle()

void pk::Transform::setAngle ( float  angle)
inline

Set the angle for the transformable (in degrees).

Parameters
floatangle - a float corresponding to an angle (in degrees).

◆ setCenter()

void pk::Transform::setCenter ( glm::vec2 &  point)
inline

Set the center point for the transformable object.

Parameters
glm::vec2&point - a glm::vec2 you want to set the center point of the transformable object to.

◆ setPosition()

void pk::Transform::setPosition ( glm::vec2  position)
inline

Set the position of the transformable in the Window.

Parameters
glm::ivec2position - a glm::ivec2 specifying a position.

◆ setTransformData()

void pk::Transform::setTransformData ( transformData t)
inline

Set the transform data for the transformable object.

Parameters
transformData&t - a transformData struct to set for the transformable object.

Member Data Documentation

◆ m_data

transformData pk::Transform::m_data
private

The raw transform data.


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