PixelLightAPI  .
Public Member Functions | Public Attributes
PLMath::Transform3 Class Reference

3D transform class More...

#include <Transform3.h>

List of all members.

Public Member Functions

PLMATH_API Transform3 ()
 Default constructor (set's an identity transform matrix)
PLMATH_API Transform3 (const Transform3 &cSource)
 Copy constructor (event data is not copied)
PLMATH_API Transform3operator= (const Transform3 &cSource)
 Copy operator (event data is not copied)
const Vector3GetPosition () const
 Gets the position.
PLMATH_API void SetPosition (const Vector3 &vPosition)
 Sets the position.
const QuaternionGetRotation () const
 Gets the rotation.
PLMATH_API void SetRotation (const Quaternion &qRotation)
 Sets the rotation.
const Vector3GetScale () const
 Gets the scale.
PLMATH_API void SetScale (const Vector3 &vScale)
 Sets the scale.
PLMATH_API const Matrix3x4GetMatrix ()
 Returns the current final transform matrix.
PLMATH_API void SetMatrix (const Matrix3x4 &mTrans)
 Sets the current final transform matrix.
PLMATH_API const Matrix3x4GetInverseMatrix ()
 Returns the current final inverse transform matrix.

Public Attributes

PLCore::Event EventPosition
PLCore::Event EventRotation
PLCore::Event EventScale

Detailed Description

3D transform class

Remarks:
The design goal of this class was not to be as memory compact as possible - for such a use case, one can use for example directly Matrix3x4. The design goal was to provide a class that is able to convert between different representations of a 3D transform in an efficient way. To achieve this, the "Lazy Evaluation"-scheme is used. This means that, for example, the inverse transform is only recalculated if it's really required. To allow a practical usage of this transform class within more advanced systems, events are provided to inform when transform data has been changed.

Constructor & Destructor Documentation

Default constructor (set's an identity transform matrix)

PLMATH_API PLMath::Transform3::Transform3 ( const Transform3 cSource)

Copy constructor (event data is not copied)

Parameters:
[in]cSourceSource to copy from

Member Function Documentation

PLMATH_API Transform3& PLMath::Transform3::operator= ( const Transform3 cSource)

Copy operator (event data is not copied)

Parameters:
[in]cSourceSource to copy from
Returns:
Reference to this instance
Note:
  • EventPosition, EventRotation and EventScale events are emitted
const Vector3 & PLMath::Transform3::GetPosition ( ) const [inline]

Gets the position.

Returns:
Position
PLMATH_API void PLMath::Transform3::SetPosition ( const Vector3 vPosition)

Sets the position.

Parameters:
[in]vPositionNew position
const Quaternion & PLMath::Transform3::GetRotation ( ) const [inline]

Gets the rotation.

Returns:
Rotation
PLMATH_API void PLMath::Transform3::SetRotation ( const Quaternion qRotation)

Sets the rotation.

Parameters:
[in]qRotationNew rotation
const Vector3 & PLMath::Transform3::GetScale ( ) const [inline]

Gets the scale.

Returns:
Scale
PLMATH_API void PLMath::Transform3::SetScale ( const Vector3 vScale)

Sets the scale.

Parameters:
[in]vScaleNew scale

Returns the current final transform matrix.

Returns:
The current final transform matrix
Note:
  • If position, rotation or scale was changed, the current transform matrix is recalculated internally before it is returned
PLMATH_API void PLMath::Transform3::SetMatrix ( const Matrix3x4 mTrans)

Sets the current final transform matrix.

Parameters:
[in]mTransThe current final transform matrix
Note:
  • The scale can't be extracted correctly from the given transform matrix if one or two scale components are negative while another is/are not (we can't figure out WHICH axis are negative!)

Returns the current final inverse transform matrix.

Returns:
The current final inverse transform matrix
Note:
  • If position, rotation or scale was changed, the current inverse transform matrix is recalculated internally before it is returned

Member Data Documentation

Position change event

Rotation change event

Scale change event


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:20
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported