Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Classes | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
jop::Transform Class Reference

#include <Transform.hpp>

Classes

struct  Variables
 

Public Member Functions

 Transform ()
 Default constructor. More...
 
 Transform (const glm::mat4 &matrix)
 Constructor. More...
 
glm::mat4 & getMatrix ()
 Get the transformation matrix. More...
 
const glm::mat4 & getMatrix () const
 Get the transformation matrix. More...
 
void rotate (const glm::quat &rotation)
 Rotate this transform. More...
 
void scale (const glm::vec3 &scale)
 Scale this transform. More...
 
void translate (const glm::vec3 &translation)
 Translate this transform. More...
 
void transformBounds (glm::vec3 &min, glm::vec3 &max) const
 Transform a bounding box. More...
 
Transformoperator*= (const Transform &right)
 Multiply this transform by another. More...
 
Transform operator* (const Transform &right) const
 Multiply this transform by another. More...
 

Static Public Attributes

static const glm::mat4 IdentityMatrix
 The identity matrix. More...
 
static const glm::vec3 Front
 The default normalized front vector. More...
 
static const glm::vec3 Right
 The default normalized right vector. More...
 
static const glm::vec3 Up
 The default normalized up vector. More...
 

Protected Attributes

glm::mat4 m_matrix
 The transformation matrix. More...
 

Detailed Description

Definition at line 35 of file Transform.hpp.

Constructor & Destructor Documentation

jop::Transform::Transform ( )

Default constructor.

Sets the identity matrix

jop::Transform::Transform ( const glm::mat4 &  matrix)
explicit

Constructor.

Parameters
matrixThe initial matrix

Member Function Documentation

glm::mat4& jop::Transform::getMatrix ( )

Get the transformation matrix.

Returns
Reference to the internal matrix
const glm::mat4& jop::Transform::getMatrix ( ) const

Get the transformation matrix.

Returns
Reference to the internal matrix
Transform jop::Transform::operator* ( const Transform right) const

Multiply this transform by another.

Parameters
rightThe right Transform
Returns
The combined transform
Transform& jop::Transform::operator*= ( const Transform right)

Multiply this transform by another.

Parameters
rightThe right transform
Returns
Reference to self
void jop::Transform::rotate ( const glm::quat &  rotation)

Rotate this transform.

Parameters
rotationThe rotation offset
void jop::Transform::scale ( const glm::vec3 &  scale)

Scale this transform.

Parameters
scaleScale multiplier
void jop::Transform::transformBounds ( glm::vec3 &  min,
glm::vec3 &  max 
) const

Transform a bounding box.

Parameters
minThe minimum coordinates
maxThe maximum coordinates
void jop::Transform::translate ( const glm::vec3 &  translation)

Translate this transform.

Parameters
translationTranslation offset

Member Data Documentation

const glm::vec3 jop::Transform::Front
static

The default normalized front vector.

Definition at line 143 of file Transform.hpp.

const glm::mat4 jop::Transform::IdentityMatrix
static

The identity matrix.

Definition at line 142 of file Transform.hpp.

glm::mat4 jop::Transform::m_matrix
protected

The transformation matrix.

Definition at line 149 of file Transform.hpp.

const glm::vec3 jop::Transform::Right
static

The default normalized right vector.

Definition at line 144 of file Transform.hpp.

const glm::vec3 jop::Transform::Up
static

The default normalized up vector.

Definition at line 145 of file Transform.hpp.


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