OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::Transform Struct Reference

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

#include <OgreTransform.h>

Public Member Functions

 Transform ()
 
void advancePack ()
 Advances all pointers to the next pack, i.e.
 
void advancePack (size_t numAdvance)
 
void copy (const Transform &inCopy)
 Copies all the scalar data from the parameter into this.
 
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.
 

Public Attributes

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

Detailed Description

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

Constructor & Destructor Documentation

◆ Transform()

Ogre::Transform::Transform ( )
inline

Member Function Documentation

◆ advancePack() [1/2]

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.

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

◆ advancePack() [2/2]

◆ copy()

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. @See rebasePtrs

Note that we do NOT copy the mIndex member.

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

◆ rebasePtrs()

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
@See 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

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

◆ mDerivedOrientation

ArrayQuaternion* RESTRICT_ALIAS Ogre::Transform::mDerivedOrientation

Caches the combined orientation from all parent nodes.

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

◆ mDerivedPosition

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mDerivedPosition

Caches the combined position from all parent nodes.

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

◆ mDerivedScale

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mDerivedScale

Caches the combined scale from all parent nodes.

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

◆ mDerivedTransform

Matrix4* RESTRICT_ALIAS Ogre::Transform::mDerivedTransform

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

Referenced by Ogre::Node::_getFullTransform(), advancePack(), advancePack(), copy(), and rebasePtrs().

◆ mIndex

unsigned char Ogre::Transform::mIndex

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

Referenced by Ogre::Node::_getFullTransform(), and copy().

◆ mInheritOrientation

bool* RESTRICT_ALIAS Ogre::Transform::mInheritOrientation

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

Ours is mInheritOrientation[mIndex]

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

◆ mInheritScale

bool* RESTRICT_ALIAS Ogre::Transform::mInheritScale

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

Ours is mInheritScale[mIndex]

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

◆ mOrientation

ArrayQuaternion* RESTRICT_ALIAS Ogre::Transform::mOrientation

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

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

◆ mOwner

Node** Ogre::Transform::mOwner

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

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

◆ mParents

Node** Ogre::Transform::mParents

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

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

◆ mPosition

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mPosition

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

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

◆ mScale

ArrayVector3* RESTRICT_ALIAS Ogre::Transform::mScale

Stores the scaling factor applied to a node.

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


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