"L. Spiro Engine"
Public Member Functions | Protected Attributes

lsm::COrientation Class Reference

Orientation of objects. More...

#include <LSMOrientation.h>

List of all members.

Public Member Functions

LSE_INLINE LSE_CALLCTOR COrientation (const COrientation &_oSrc)
LSE_INLINE COrientation &LSE_FCALL operator= (const COrientation &_oSrc)
LSE_INLINE const CVector3
&LSE_FCALL 
GetScale () const
LSE_INLINE const CVector3
&LSE_FCALL 
GetPos () const
LSE_INLINE const CVector3
&LSE_FCALL 
GetForward () const
LSE_INLINE const CVector3
&LSE_FCALL 
GetRight () const
LSE_INLINE const CVector3
&LSE_FCALL 
GetUp () const
LSVOID LSE_FCALL SetIdentity ()
LSVOID LSE_FCALL ClearPosition ()
LSVOID LSE_FCALL ClearRotation ()
LSVOID LSE_FCALL ClearScale ()
LSVOID LSE_FCALL SetPos (const CVector3 &_vPos)
LSVOID LSE_FCALL SetPosU (const CVector3 &_vPos)
LSVOID LSE_FCALL AddPos (const CVector3 &_vPos)
LSVOID LSE_FCALL SetRelPos (const CVector3 &_vPos)
LSVOID LSE_FCALL AddRelPos (const CVector3 &_vPos)
LSVOID LSE_FCALL SetRotation (const CMatrix4x4 &_mMat)
LSVOID LSE_FCALL AddRotation (const CMatrix4x4 &_mMat)
LSVOID LSE_FCALL SetRotation (const CVector3 &_vForward, const CVector3 &_vUp)
LSVOID LSE_FCALL SetRotationEasy (const CVector3 &_vForward, const CVector3 &_vUp)
LSVOID LSE_FCALL AddRotation (const CVector3 &_vForward, const CVector3 &_vUp)
LSVOID LSE_FCALL Yaw (LSREAL _fAmount)
LSVOID LSE_FCALL SetYaw (LSREAL _fAmount)
LSVOID LSE_FCALL Pitch (LSREAL _fAmount)
LSVOID LSE_FCALL Roll (LSREAL _fAmount)
LSVOID LSE_FCALL SetRotationYawPitchRoll (LSREAL _fYaw, LSREAL _fPitch, LSREAL _fRoll)
LSVOID LSE_FCALL SetScale (const CVector3 &_vScale)
LSVOID LSE_FCALL AddScale (const CVector3 &_vScale)
LSVOID LSE_FCALL SetScale (LSREAL _fScale)
LSVOID LSE_FCALL AddScale (LSREAL _fScale)
LSVOID LSE_FCALL BuildMatrix (CMatrix4x4 &_mRet) const
LSBOOL LSE_FCALL UpdateMatrix (CMatrix4x4 &_mRet, LSBOOL _bClearDirty=true) const
LSE_INLINE LSBOOL LSE_FCALL IsDirty () const
LSE_INLINE LSVOID LSE_FCALL MakeDirty ()
LSE_INLINE LSVOID LSE_FCALL UndirtyRotations () const

Protected Attributes

CVector3 m_vRight
CVector3 m_vUp
CVector3 m_vForward
CVector3 m_vPos
CVector3 m_vScale
LSUINT32 m_ui32Dirty

Detailed Description

Orientation of objects.

Class COrientation Description: A base class for all objects that can have an orientation in 3D.


Member Function Documentation

LSVOID LSE_FCALL lsm::COrientation::AddPos ( const CVector3 _vPos)

Offset this position by a given amount.

Parameters:
_vPosThe position to add to this orientation.
LSVOID LSE_FCALL lsm::COrientation::AddRelPos ( const CVector3 _vPos)

Offset the position of this orientation relative to its facing direction.

Parameters:
_vPosThe position to add to this orientation.
LSVOID LSE_FCALL lsm::COrientation::AddRotation ( const CMatrix4x4 _mMat)

Add a rotation to the existing rotation of this object.

Parameters:
_mMatThe rotation, in matrix form, to add to the existing rotation of this object.
LSVOID LSE_FCALL lsm::COrientation::AddRotation ( const CVector3 _vForward,
const CVector3 _vUp 
)

Add a rotation to this object from forward and up vectors. The right vector is derived automatically.

Parameters:
_vForwardThe forward component of the rotation to add.
_vUpThe up component of the rotation to add.
LSVOID LSE_FCALL lsm::COrientation::AddScale ( const CVector3 _vScale)

Add to the current scale of this object.

Parameters:
_vScaleThe scale to add to the existing scale of this object.
LSVOID LSE_FCALL lsm::COrientation::AddScale ( LSREAL  _fScale)

Add to the current scale of this object.

Parameters:
_fScaleThe scale to add to the existing scale of this object.
LSVOID LSE_FCALL lsm::COrientation::BuildMatrix ( CMatrix4x4 _mRet) const

Build a matrix from our data.

Parameters:
_mRetHolds the created matrix.
LSVOID LSE_FCALL lsm::COrientation::ClearPosition ( )

Set the position to [0,0,0].

LSVOID LSE_FCALL lsm::COrientation::ClearRotation ( )

Set the rotation to identity.

LSVOID LSE_FCALL lsm::COrientation::ClearScale ( )

Set the scale to [1,1,1].

LSE_INLINE const CVector3 &LSE_FCALL lsm::COrientation::GetForward ( ) const

Get the forward vector.

Returns:
Returns the forward vector of this orientation.
LSE_INLINE const CVector3 &LSE_FCALL lsm::COrientation::GetPos ( ) const

Get the position.

Returns:
Returns the position of this orientation.
LSE_INLINE const CVector3 &LSE_FCALL lsm::COrientation::GetRight ( ) const

Get the right vector.

Returns:
Returns the right vector of this orientation.
LSE_INLINE const CVector3 &LSE_FCALL lsm::COrientation::GetScale ( ) const

Get the scale.

Returns:
Returns the scale of this orientation.
LSE_INLINE const CVector3 &LSE_FCALL lsm::COrientation::GetUp ( ) const

Get the up vector.

Returns:
Returns the up vector of this orientation.
LSE_INLINE LSBOOL LSE_FCALL lsm::COrientation::IsDirty ( ) const

Are we dirty at all?

Returns:
Returns true if the orientation is dirty and needs to update matrices.
LSE_INLINE LSVOID LSE_FCALL lsm::COrientation::MakeDirty ( )

Make us dirty. This causes an update at the next UpdateMatrix() call.

LSE_INLINE COrientation &LSE_FCALL lsm::COrientation::operator= ( const COrientation _oSrc)

Copy an orientation. The dirty flag on the copied orientation is always set after this operation.

Parameters:
_oSrcThe source orientation.
Returns:
Returns the copied object.
LSVOID LSE_FCALL lsm::COrientation::Pitch ( LSREAL  _fAmount)

Pitch the orientation by the given amount. The object always rotates around its right axis.

Parameters:
_fAmountAmount, in radians, to pitch.
LSVOID LSE_FCALL lsm::COrientation::Roll ( LSREAL  _fAmount)

Roll the orientation by the given amount. The object always rotates around its forward axis.

Parameters:
_fAmountAmount, in radians, to roll.
LSVOID LSE_FCALL lsm::COrientation::SetIdentity ( )

Set the orientation to identity.

LSVOID LSE_FCALL lsm::COrientation::SetPos ( const CVector3 _vPos)

Set the absolute position.

Parameters:
_vPosThe position to apply to this orientation.
LSVOID LSE_FCALL lsm::COrientation::SetPosU ( const CVector3 _vPos)

Set the absolute position. Only causes a change if the given position is not the same as the current position.

Parameters:
_vPosThe position to apply to this orientation.
LSVOID LSE_FCALL lsm::COrientation::SetRelPos ( const CVector3 _vPos)

Set the position of this orientation relative to its facing direction.

Parameters:
_vPosThe position to apply to this orientation.
LSVOID LSE_FCALL lsm::COrientation::SetRotation ( const CMatrix4x4 _mMat)

Set the rotation component of this orientation.

Parameters:
_mMatThe full rotational component to apply to this object.
LSVOID LSE_FCALL lsm::COrientation::SetRotation ( const CVector3 _vForward,
const CVector3 _vUp 
)

Set the rotation component of this object from forward and up vectors. The right vector is derived automatically.

Parameters:
_vForwardThe forward component of the rotation.
_vUpThe up component of the rotation.
LSVOID LSE_FCALL lsm::COrientation::SetRotationEasy ( const CVector3 _vForward,
const CVector3 _vUp 
)

Set the rotation component of this object from forward and up vectors. The right vector is derived automatically and the up vector is adjusted.

Parameters:
_vForwardThe forward component of the rotation.
_vUpThe up component of the rotation.
LSVOID LSE_FCALL lsm::COrientation::SetRotationYawPitchRoll ( LSREAL  _fYaw,
LSREAL  _fPitch,
LSREAL  _fRoll 
)

Set the rotation by the given yaw, pitch, and roll.

Parameters:
_fYawYaw around the Y axis, in radians.
_fPitchPitch around the X axis, in radians.
_fRollRoll around the Z axis, in radians.
LSVOID LSE_FCALL lsm::COrientation::SetScale ( const CVector3 _vScale)

Set the scale.

Parameters:
_vScaleThe new scale of this orientation.
LSVOID LSE_FCALL lsm::COrientation::SetScale ( LSREAL  _fScale)

Set the scale.

Parameters:
_fScaleThe new scale of this orientation.
LSVOID LSE_FCALL lsm::COrientation::SetYaw ( LSREAL  _fAmount)

Set the yaw to the given amount. The object always rotates around axis [0,1,0].

Parameters:
_fAmountAmount, in radians, to which to set the yaw.
LSE_INLINE LSVOID LSE_FCALL lsm::COrientation::UndirtyRotations ( ) const

Undirty rotations if necessary.

LSBOOL LSE_FCALL lsm::COrientation::UpdateMatrix ( CMatrix4x4 _mRet,
LSBOOL  _bClearDirty = true 
) const

Updates, if necessary, the orientation, filling the given matrix with the result. If the orientation has not been modified since the last update, no action is performed.

Parameters:
_mRetHolds the created matrix.
_bClearDirtyDetermines whether the dirty flag will be cleared after this update. This function only updates the given matrix if the dirty flag is set, so clearing the dirty flag results in no more updates until the orientation is modified in some way. In this manner, updates are only performed when needed.
Returns:
Returns true if an update was performed.
LSVOID LSE_FCALL lsm::COrientation::Yaw ( LSREAL  _fAmount)

Yaw the orientation by the given amount. The object always rotates around axis [0,1,0].

Parameters:
_fAmountAmount, in radians, to yaw.

Member Data Documentation

LSUINT32 lsm::COrientation::m_ui32Dirty [mutable, protected]

Dirty flags.

Position.

CVector3 lsm::COrientation::m_vRight [mutable, protected]

Orientation.

Scale.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator