Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
om::graphics::base::Transformable Class Reference

A base class for objects that have a 3D transformation from object to world space. More...

#include <omGraphicsTransformable.h>

Inheritance diagram for om::graphics::base::Transformable:
om::graphics::cameras::Camera om::graphics::scenes::GraphicsObject

Public Member Functions

 Transformable ()
 Create a new transformable with the identity transformation. More...
 
 Transformable (const Transform3 &newTransform)
 Create a new transformable with the specified transformation. More...
 
virtual ~Transformable ()
 Destroy this transformable, releasing all associated resources. More...
 
const Vector3getPosition () const
 Return the position of this transformable. More...
 
void setPosition (const Vector3 &newPosition)
 Set the position of this transformable. More...
 
const Matrix3getOrientation () const
 Return the orientation of this transformable. More...
 
void setOrientation (const Matrix3 &newOrientation)
 Set the orientation of this transformable. More...
 
const Vector3getScale () const
 Get the scale of the transformable. More...
 
void setScale (Real newScale)
 Set the scale of the transformable uniformly for all dimensions. More...
 
void setScale (const Vector3 &newScale)
 Set the scale of the transformable. More...
 
const Transform3getTransform () const
 Return the transformation for this transformable between its local and parent coordinate frame. More...
 
void setTransform (const Transform3 &newTransform)
 Set the transformation for this transformable between its local and parent coordinate frame. More...
 
Matrix4 getTransformMatrix () const
 Return a 4x4 matrix representing the transformation from object to world space. More...
 
Matrix4 getTransformMatrixInverse () const
 Return a 4x4 matrix which transforms points from world space to object space. More...
 
Sphere3 getBoundingSphere () const
 Return a bounding sphere for this transformable in its parent coordinate space. More...
 
Sphere3 getLocalBoundingSphere () const
 Return a bounding sphere for this transformable in its local coordinate space. More...
 
const AABB3getBoundingBox () const
 Return an axis-aligned bounding box that encompases this entire transformable in its parent coordinate space. More...
 
const AABB3getLocalBoundingBox () const
 Return an axis-aligned bounding box that encompases this entire transformable in its local coordinate space. More...
 
virtual void updateBoundingBox ()
 Update the transformable's bounding box based on its current geometric representation. More...
 

Protected Member Functions

void setLocalBoundingBox (const AABB3 &newLocalBoundingBox)
 Set the local axis-aligned bounding box for this shape. More...
 

Protected Attributes

Transform3 transform
 The transformation for this transformable between its local and parent coordinate frame. More...
 

Detailed Description

A base class for objects that have a 3D transformation from object to world space.

This is the base class for other types that have a transformation, such as objects, shapes, and cameras. It gives them a common interface for graphics systems like animation.

Constructor & Destructor Documentation

om::graphics::base::Transformable::Transformable ( )

Create a new transformable with the identity transformation.

om::graphics::base::Transformable::Transformable ( const Transform3 newTransform)

Create a new transformable with the specified transformation.

virtual om::graphics::base::Transformable::~Transformable ( )
virtual

Destroy this transformable, releasing all associated resources.

Member Function Documentation

const Vector3& om::graphics::base::Transformable::getPosition ( ) const
inline

Return the position of this transformable.

This position is specifid relative to the origin of the enclosing coordinate space.

void om::graphics::base::Transformable::setPosition ( const Vector3 newPosition)
inline

Set the position of this transformable.

This position is specifid relative to the origin of the enclosing coordinate space.

const Matrix3& om::graphics::base::Transformable::getOrientation ( ) const
inline

Return the orientation of this transformable.

void om::graphics::base::Transformable::setOrientation ( const Matrix3 newOrientation)

Set the orientation of this transformable.

const Vector3& om::graphics::base::Transformable::getScale ( ) const
inline

Get the scale of the transformable.

void om::graphics::base::Transformable::setScale ( Real  newScale)
inline

Set the scale of the transformable uniformly for all dimensions.

void om::graphics::base::Transformable::setScale ( const Vector3 newScale)
inline

Set the scale of the transformable.

const Transform3& om::graphics::base::Transformable::getTransform ( ) const
inline

Return the transformation for this transformable between its local and parent coordinate frame.

void om::graphics::base::Transformable::setTransform ( const Transform3 newTransform)

Set the transformation for this transformable between its local and parent coordinate frame.

This method ensures that the transformable's new orientation matrix is orthonormal.

Matrix4 om::graphics::base::Transformable::getTransformMatrix ( ) const

Return a 4x4 matrix representing the transformation from object to world space.

Matrix4 om::graphics::base::Transformable::getTransformMatrixInverse ( ) const

Return a 4x4 matrix which transforms points from world space to object space.

Sphere3 om::graphics::base::Transformable::getBoundingSphere ( ) const
inline

Return a bounding sphere for this transformable in its parent coordinate space.

Sphere3 om::graphics::base::Transformable::getLocalBoundingSphere ( ) const
inline

Return a bounding sphere for this transformable in its local coordinate space.

const AABB3& om::graphics::base::Transformable::getBoundingBox ( ) const
inline

Return an axis-aligned bounding box that encompases this entire transformable in its parent coordinate space.

const AABB3& om::graphics::base::Transformable::getLocalBoundingBox ( ) const
inline

Return an axis-aligned bounding box that encompases this entire transformable in its local coordinate space.

virtual void om::graphics::base::Transformable::updateBoundingBox ( )
virtual

Update the transformable's bounding box based on its current geometric representation.

Reimplemented in om::graphics::scenes::GraphicsObject.

void om::graphics::base::Transformable::setLocalBoundingBox ( const AABB3 newLocalBoundingBox)
inlineprotected

Set the local axis-aligned bounding box for this shape.

Shape subclasses should call this method to set the bounding box of their geometry in their local coordinate frames (before applying the shape's own transformation).

Member Data Documentation

Transform3 om::graphics::base::Transformable::transform
protected

The transformation for this transformable between its local and parent coordinate frame.


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