OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::ObjectData Struct Reference

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

#include <OgreObjectData.h>

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

RealAsUint *RESTRICT_ALIAS mDistanceToCamera
 Ours is mDistanceToCamera[mIndex]. More...
 
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
 @See 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...
 
RealmUpperDistance [2]
 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)

Constructor & Destructor Documentation

◆ ObjectData()

Ogre::ObjectData::ObjectData ( )
inline

References mUpperDistance.

Member Function Documentation

◆ advanceBoundsPack()

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.

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

◆ advanceCullLightPack()

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.

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

◆ advanceDirtyInstanceMgr()

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.

References ARRAY_PACKED_REALS, mVisibilityFlags, mWorldAabb, and mWorldRadius.

◆ advanceFrustumPack()

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.

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

◆ advanceLightPack()

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.

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

◆ advanceLodPack()

void Ogre::ObjectData::advanceLodPack ( )
inline

◆ advancePack() [1/2]

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.

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

◆ advancePack() [2/2]

void Ogre::ObjectData::advancePack ( size_t  numAdvance)
inline

◆ copy()

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

Note that we do NOT copy the mIndex member.

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

Member Data Documentation

◆ mDistanceToCamera

RealAsUint* RESTRICT_ALIAS Ogre::ObjectData::mDistanceToCamera

Ours is mDistanceToCamera[mIndex].

It is the distance to camera. Value can be negative to account for radius (i.e. when the camera is "inside" the bounds of the object)

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

◆ mIndex

unsigned char Ogre::ObjectData::mIndex

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

Referenced by copy().

◆ mLightMask

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)

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

◆ mLocalAabb

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).

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

◆ mLocalRadius

Real* RESTRICT_ALIAS Ogre::ObjectData::mLocalRadius

@See mLocalAabb

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

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

◆ mOwner

MovableObject** Ogre::ObjectData::mOwner

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

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

◆ mParents

Node** Ogre::ObjectData::mParents

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

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

◆ mQueryFlags

uint32* RESTRICT_ALIAS Ogre::ObjectData::mQueryFlags

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

Referenced by advancePack(), and copy().

◆ mUpperDistance

Real* Ogre::ObjectData::mUpperDistance[2]

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

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

◆ mVisibilityFlags

uint32* RESTRICT_ALIAS Ogre::ObjectData::mVisibilityFlags

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

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

◆ mWorldAabb

◆ mWorldRadius

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

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


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