YAGE  1.0
Yet Another Game Engine
Transform Class Reference

Transform composed of Scale, Rotation (as a quaternion), and Translation. Transformation is applied in the order: Scale -> Rotate -> Translate. More...

#include <Transform.h>

Public Member Functions

 Transform ()
 
 Transform (glm::vec3 position, float scale, glm::quat rotation)
 
void SetScale (float scale)
 Sets a scale. More...
 
void SetPosition (const glm::vec3 &position)
 Sets a position. More...
 
void SetRotation (float angle, glm::vec3 axis)
 Sets a rotation. More...
 
void IncRotation (float angle, glm::vec3 axis)
 Increment rotation. More...
 
void RotateX (float angle)
 Rotate along x axis. More...
 
void RotateY (float angle)
 Rotate along y axis. More...
 
void RotateZ (float angle)
 Rotate along z axis. More...
 
glm::mat4 getTranslationMatrix () const
 Gets translation matrix. More...
 
glm::mat4 getScaleMatrix () const
 Gets scale matrix. More...
 
glm::mat4 getRotationMatrix () const
 Gets rotation matrix. More...
 
glm::mat4 getTransformMatrix () const
 Gets transformation matrix. Transformation applied in the order: Scale -> Rotate -> Translate. More...
 
Transformoperator= (const btTransform &trans)
 Assignment operator. More...
 
 ~Transform ()
 

Public Attributes

glm::vec3 position
 
glm::quat rotation
 
float scale
 

Detailed Description

Transform composed of Scale, Rotation (as a quaternion), and Translation. Transformation is applied in the order: Scale -> Rotate -> Translate.

Constructor & Destructor Documentation

Transform::Transform ( )
Transform::Transform ( glm::vec3  position,
float  scale,
glm::quat  rotation 
)
Transform::~Transform ( )

Member Function Documentation

glm::mat4 Transform::getRotationMatrix ( ) const

Gets rotation matrix.

Returns
The rotation matrix.
glm::mat4 Transform::getScaleMatrix ( ) const

Gets scale matrix.

Returns
The scale matrix.
glm::mat4 Transform::getTransformMatrix ( ) const

Gets transformation matrix. Transformation applied in the order: Scale -> Rotate -> Translate.

Returns
The transform matrix.
glm::mat4 Transform::getTranslationMatrix ( ) const

Gets translation matrix.

Returns
The translation matrix.
void Transform::IncRotation ( float  angle,
glm::vec3  axis 
)

Increment rotation.

Parameters
angleThe angle in degrees.
axisThe axis.
Transform & Transform::operator= ( const btTransform &  trans)

Assignment operator.

Parameters
transThe transform from ASSIMP
Returns
A shallow copy of this object.
void Transform::RotateX ( float  angle)

Rotate along x axis.

Parameters
angleThe angle in degrees.
void Transform::RotateY ( float  angle)

Rotate along y axis.

Parameters
angleThe angle in degrees.
void Transform::RotateZ ( float  angle)

Rotate along z axis.

Parameters
angleThe angle in degrees.
void Transform::SetPosition ( const glm::vec3 &  position)

Sets a position.

Parameters
positionThe position.
void Transform::SetRotation ( float  angle,
glm::vec3  axis 
)

Sets a rotation.

Parameters
angleThe angle in degrees.
axisThe axis.
void Transform::SetScale ( float  scale)

Sets a scale.

Parameters
scaleThe scale.

Member Data Documentation

glm::vec3 Transform::position
glm::quat Transform::rotation
float Transform::scale