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

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

#include <OgreObjectData.h>

+ Collaboration diagram for Ogre::ObjectData:

Public Member Functions

 ObjectData ()
 
void advanceBoundsPack ()
 Advances all pointers needed by MovableObject::updateAllBounds to the next pack, i.e. More...
 
void advanceCullLightPack ()
 Advances all pointers needed by MovableObject::cullLights to the next pack, i.e. More...
 
void advanceDirtyInstanceMgr ()
 Advances all pointers needed by InstanceBatch::_updateBounds to the next pack, i.e. More...
 
void advanceFrustumPack ()
 Advances all pointers needed by MovableObject::cullFrustum to the next pack, i.e. More...
 
void advanceLightPack ()
 Advances all pointers needed by MovableObject::buildLightList to the next pack, i.e. More...
 
void advanceLodPack ()
 
void advancePack ()
 Advances all pointers to the next pack, i.e. More...
 
void advancePack (size_t numAdvance)
 
void copy (const ObjectData &inCopy)
 Copies all the scalar data from the parameter into this. More...
 

Public Attributes

unsigned char mIndex
 Which of the packed values is ours. Value in range [0; 4) for SSE2. More...
 
uint32 *RESTRICT_ALIAS mLightMask
 The light mask defined for this movable. More...
 
ArrayAabb *RESTRICT_ALIAS mLocalAabb
 Bounding box in local space. More...
 
Real *RESTRICT_ALIAS mLocalRadius
 mLocalAabb More...
 
MovableObject ** mOwner
 The movable object that owns this ObjectData. Ours is mOwner[mIndex]. More...
 
Node ** mParents
 Holds the pointers to each parent. Ours is mParents[mIndex]. More...
 
uint32 *RESTRICT_ALIAS mQueryFlags
 Flags determining whether this object is included / excluded from scene queries. More...
 
Real *RESTRICT_ALIAS mUpperDistance
 Upper distance to still render. Ours is mUpperDistance[mIndex]. More...
 
uint32 *RESTRICT_ALIAS mVisibilityFlags
 Flags determining whether this object is visible (compared to SceneManager mask) More...
 
ArrayAabb *RESTRICT_ALIAS mWorldAabb
 Bounding box in world space. More...
 
Real *RESTRICT_ALIAS mWorldRadius
 Ours is mWorldRadius[mIndex]. More...
 

Detailed Description

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

Definition at line 38 of file OgreObjectData.h.

Constructor & Destructor Documentation

Ogre::ObjectData::ObjectData ( )
inline

Definition at line 92 of file OgreObjectData.h.

Member Function Documentation

void Ogre::ObjectData::advanceBoundsPack ( )
inline

Advances all pointers needed by MovableObject::updateAllBounds to the next pack, i.e.

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

Definition at line 160 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mLocalAabb, mLocalRadius, mOwner, mParents, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::advanceCullLightPack ( )
inline

Advances all pointers needed by MovableObject::cullLights to the next pack, i.e.

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

Definition at line 197 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mLightMask, mOwner, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::advanceDirtyInstanceMgr ( )
inline

Advances all pointers needed by InstanceBatch::_updateBounds to the next pack, i.e.

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

Definition at line 187 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mVisibilityFlags, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::advanceFrustumPack ( )
inline

Advances all pointers needed by MovableObject::cullFrustum to the next pack, i.e.

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

Definition at line 175 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mOwner, mUpperDistance, mVisibilityFlags, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::advanceLightPack ( )
inline

Advances all pointers needed by MovableObject::buildLightList to the next pack, i.e.

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

Definition at line 208 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mLightMask, mOwner, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::advanceLodPack ( )
inline

Definition at line 216 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mOwner, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::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 129 of file OgreObjectData.h.

References ARRAY_PACKED_REALS, mLightMask, mLocalAabb, mLocalRadius, mOwner, mParents, mQueryFlags, mUpperDistance, mVisibilityFlags, mWorldAabb, and mWorldRadius.

void Ogre::ObjectData::advancePack ( size_t  numAdvance)
inline
void Ogre::ObjectData::copy ( const ObjectData 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 106 of file OgreObjectData.h.

References Ogre::ArrayAabb::getAsAabb(), mIndex, mLightMask, mLocalAabb, mLocalRadius, mOwner, mParents, mQueryFlags, mUpperDistance, mVisibilityFlags, mWorldAabb, mWorldRadius, and Ogre::ArrayAabb::setFromAabb().

Member Data Documentation

unsigned char Ogre::ObjectData::mIndex

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

Definition at line 41 of file OgreObjectData.h.

Referenced by copy().

uint32* RESTRICT_ALIAS Ogre::ObjectData::mLightMask

The light mask defined for this movable.

This will be taken into consideration when deciding which light should affect this movable

Remarks
Since Lights object don't use this value, we reserve the value to either 0xffffffff or 0; using 0 to avoid adding null mOwner pointers to vectors (due to the SoA nature of working 4 items at a time, even if we just have 2 or 3)

Definition at line 90 of file OgreObjectData.h.

Referenced by advanceCullLightPack(), advanceLightPack(), advancePack(), and copy().

ArrayAabb* RESTRICT_ALIAS Ogre::ObjectData::mLocalAabb

Bounding box in local space.

It's argueable whether it should be like this, or pointer to a shared aabb (i.e. mesh aabb) to save RAM at the cost of another level of indirection, and converting AoS to SoA, but it's more convenient for SIMD processing to store each local aabb in the movable object (maximize throughput).

Definition at line 54 of file OgreObjectData.h.

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

Real* RESTRICT_ALIAS Ogre::ObjectData::mLocalRadius

mLocalAabb

Remarks
Its center is at mLocalAabb's center, not at the position or origin

Definition at line 65 of file OgreObjectData.h.

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

MovableObject** Ogre::ObjectData::mOwner

The movable object that owns this ObjectData. Ours is mOwner[mIndex].

Definition at line 47 of file OgreObjectData.h.

Referenced by advanceBoundsPack(), advanceCullLightPack(), advanceFrustumPack(), advanceLightPack(), advanceLodPack(), advancePack(), and copy().

Node** Ogre::ObjectData::mParents

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

Definition at line 44 of file OgreObjectData.h.

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

uint32* RESTRICT_ALIAS Ogre::ObjectData::mQueryFlags

Flags determining whether this object is included / excluded from scene queries.

Definition at line 81 of file OgreObjectData.h.

Referenced by advancePack(), and copy().

Real* RESTRICT_ALIAS Ogre::ObjectData::mUpperDistance

Upper distance to still render. Ours is mUpperDistance[mIndex].

Definition at line 75 of file OgreObjectData.h.

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

uint32* RESTRICT_ALIAS Ogre::ObjectData::mVisibilityFlags

Flags determining whether this object is visible (compared to SceneManager mask)

Definition at line 78 of file OgreObjectData.h.

Referenced by advanceDirtyInstanceMgr(), advanceFrustumPack(), advancePack(), and copy().

ArrayAabb* RESTRICT_ALIAS Ogre::ObjectData::mWorldAabb
Real* RESTRICT_ALIAS Ogre::ObjectData::mWorldRadius

Ours is mWorldRadius[mIndex].

It is the local radius transformed by scale An ArraySphere out of mWorldAabb & WorldRadius for computations

Remarks
Its center is at mWorldAabb's, not at the derived position

Definition at line 72 of file OgreObjectData.h.

Referenced by advanceBoundsPack(), advanceCullLightPack(), advanceDirtyInstanceMgr(), advanceFrustumPack(), advanceLightPack(), advanceLodPack(), advancePack(), and copy().


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