OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Transform Struct Reference

Represents the transform of a single object, arranged in SoA (Structure of Arrays) More...

#include <OgreTransform.h>

+ Collaboration diagram for Ogre::Transform:

Public Member Functions

 Transform ()
 
void advancePack ()
 Advances all pointers to the next pack, i.e. More...
 
void advancePack (size_t numAdvance)
 
void copy (const Transform &inCopy)
 Copies all the scalar data from the parameter into this. More...
 
void rebasePtrs (const MemoryPoolVec &newBasePtrs, const ptrdiff_t diff)
 Rebases all the pointers from our SoA structs so that they point to a new location calculated from a base pointer, and a difference offset. More...
 

Public Attributes

ArrayQuaternion *RESTRICT_ALIAS mDerivedOrientation
 Caches the combined orientation from all parent nodes. More...
 
ArrayVector3 *RESTRICT_ALIAS mDerivedPosition
 Caches the combined position from all parent nodes. More...
 
ArrayVector3 *RESTRICT_ALIAS mDerivedScale
 Caches the combined scale from all parent nodes. More...
 
Matrix4 *RESTRICT_ALIAS mDerivedTransform
 Caches the full transform into a 4x4 matrix. Note it's not Array form! (It's AoS) More...
 
unsigned char mIndex
 Which of the packed values is ours. Value in range [0; 4) for SSE2. More...
 
bool *RESTRICT_ALIAS mInheritOrientation
 Stores whether this node inherits orientation from it's parent. More...
 
bool *RESTRICT_ALIAS mInheritScale
 Stores whether this node inherits scale from it's parent. More...
 
ArrayQuaternion *RESTRICT_ALIAS mOrientation
 Stores the orientation of a node relative to it's parent. More...
 
Node ** mOwner
 The Node that owns this Transform. Ours is mOwner[mIndex]. More...
 
Node ** mParents
 Holds the pointers to each parent. Ours is mParents[mIndex]. More...
 
ArrayVector3 *RESTRICT_ALIAS mPosition
 Stores the position/translation of a node relative to its parent. More...
 
ArrayVector3 *RESTRICT_ALIAS mScale
 Stores the scaling factor applied to a node. More...
 

Detailed Description

Represents the transform of a single object, arranged in SoA (Structure of Arrays)

Definition at line 37 of file OgreTransform.h.

Constructor & Destructor Documentation

Ogre::Transform::Transform ( )
inline

Definition at line 77 of file OgreTransform.h.

Member Function Documentation

void Ogre::Transform::advancePack ( )
inline

Advances all pointers to the next pack, i.e.

if we're processing 4 elements at a time, move to the next 4 elements.

Definition at line 182 of file OgreTransform.h.

References ARRAY_PACKED_REALS, mDerivedOrientation, mDerivedPosition, mDerivedScale, mDerivedTransform, mInheritOrientation, mInheritScale, mOrientation, mOwner, mParents, mPosition, and mScale.

void Ogre::Transform::advancePack ( size_t  numAdvance)
inline
void Ogre::Transform::copy ( const Transform inCopy)
inline

Copies all the scalar data from the parameter into this.

Remarks
A normal "=" operator, or an assignment constructor Transform( Transform & ) wouldn't work. This is because ArrayVector3 & co. would try to copy all the packed values, while we just want the scalar ones.

Furthermore, it would be confusing, because it would be not clear whether those two options should memcpy memory, or rebase the pointers, hence explicit functions are much preferred. rebasePtrs

Note that we do NOT copy the mIndex member.

Definition at line 105 of file OgreTransform.h.

References Ogre::ArrayQuaternion::getAsQuaternion(), Ogre::ArrayVector3::getAsVector3(), mDerivedOrientation, mDerivedPosition, mDerivedScale, mDerivedTransform, mIndex, mInheritOrientation, mInheritScale, mOrientation, mOwner, mParents, mPosition, mScale, Ogre::ArrayQuaternion::setFromQuaternion(), and Ogre::ArrayVector3::setFromVector3().

void Ogre::Transform::rebasePtrs ( const MemoryPoolVec newBasePtrs,
const ptrdiff_t  diff 
)
inline

Rebases all the pointers from our SoA structs so that they point to a new location calculated from a base pointer, and a difference offset.

The index (i.e. mPosition._getIndex()) is assumed to stay the same

Remarks
RebaseListener This function is intended to be used when the pool memory is growing hence the memory base address may change, so we need to reallocate and update all pointers accordingly

Definition at line 151 of file OgreTransform.h.

References Ogre::NodeArrayMemoryManager::DerivedOrientation, Ogre::NodeArrayMemoryManager::DerivedPosition, Ogre::NodeArrayMemoryManager::DerivedScale, Ogre::NodeArrayMemoryManager::InheritOrientation, Ogre::NodeArrayMemoryManager::InheritScale, mDerivedOrientation, mDerivedPosition, mDerivedScale, mDerivedTransform, mInheritOrientation, mInheritScale, mOrientation, mOwner, mParents, mPosition, mScale, Ogre::NodeArrayMemoryManager::Orientation, Ogre::NodeArrayMemoryManager::Owner, Ogre::NodeArrayMemoryManager::Parent, Ogre::NodeArrayMemoryManager::Position, Ogre::NodeArrayMemoryManager::Scale, and Ogre::NodeArrayMemoryManager::WorldMat.

Member Data Documentation

ArrayQuaternion* RESTRICT_ALIAS Ogre::Transform::mDerivedOrientation

Caches the combined orientation from all parent nodes.

Definition at line 61 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mDerivedPosition

Caches the combined position from all parent nodes.

Definition at line 58 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mDerivedScale

Caches the combined scale from all parent nodes.

Definition at line 64 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

Matrix4* RESTRICT_ALIAS Ogre::Transform::mDerivedTransform

Caches the full transform into a 4x4 matrix. Note it's not Array form! (It's AoS)

Definition at line 67 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

unsigned char Ogre::Transform::mIndex

Which of the packed values is ours. Value in range [0; 4) for SSE2.

Definition at line 40 of file OgreTransform.h.

Referenced by copy().

bool* RESTRICT_ALIAS Ogre::Transform::mInheritOrientation

Stores whether this node inherits orientation from it's parent.

Ours is mInheritOrientation[mIndex]

Definition at line 71 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

bool* RESTRICT_ALIAS Ogre::Transform::mInheritScale

Stores whether this node inherits scale from it's parent.

Ours is mInheritScale[mIndex]

Definition at line 75 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

ArrayQuaternion* RESTRICT_ALIAS Ogre::Transform::mOrientation

Stores the orientation of a node relative to it's parent.

Definition at line 52 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

Node** Ogre::Transform::mOwner

The Node that owns this Transform. Ours is mOwner[mIndex].

Definition at line 46 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

Node** Ogre::Transform::mParents

Holds the pointers to each parent. Ours is mParents[mIndex].

Definition at line 43 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mPosition

Stores the position/translation of a node relative to its parent.

Definition at line 49 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mScale

Stores the scaling factor applied to a node.

Definition at line 55 of file OgreTransform.h.

Referenced by advancePack(), copy(), and rebasePtrs().


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