Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CRenderableObject Class Referenceabstract

#include <RenderableObject.h>

Inheritance diagram for CRenderableObject:
CModelAbstract CPatch CModel CModelDecal CModelParticleEmitter

Public Member Functions

 CRenderableObject ()
 
virtual ~CRenderableObject ()
 
virtual void SetTransform (const CMatrix3D &transform)
 
const CMatrix3DGetTransform () const
 
const CMatrix3DGetInvTransform () const
 
void SetDirty (u32 dirtyflags)
 
virtual void CalcBounds ()=0
 (Re)calculates and stores any bounds or bound-dependent data for this object. More...
 
const CBoundingBoxAlignedGetWorldBounds ()
 Returns the world-space axis-aligned bounds of this object. More...
 
virtual void InvalidateBounds ()
 Marks the bounds as invalid. More...
 
void SetRenderData (CRenderData *renderdata)
 
CRenderDataGetRenderData ()
 Return object renderdata - can be null if renderer hasn't yet created the renderdata. More...
 

Protected Member Functions

void RecalculateBoundsIfNecessary ()
 Factored out so subclasses don't need to repeat this if they want to add additional getters for bounds-related methods (since they'll have to make sure to recalc the bounds if necessary before they return it). More...
 

Protected Attributes

CBoundingBoxAligned m_WorldBounds
 World-space bounds of this object. More...
 
CMatrix3D m_Transform
 
CMatrix3D m_InvTransform
 
CRenderDatam_RenderData
 
bool m_BoundsValid
 Remembers whether any bounds need to be recalculated. More...
 

Private Member Functions

 NONCOPYABLE (CRenderableObject)
 

Detailed Description

Definition at line 54 of file RenderableObject.h.

Constructor & Destructor Documentation

CRenderableObject::CRenderableObject ( )
inline

Definition at line 60 of file RenderableObject.h.

virtual CRenderableObject::~CRenderableObject ( )
inlinevirtual

Definition at line 65 of file RenderableObject.h.

Member Function Documentation

virtual void CRenderableObject::CalcBounds ( )
pure virtual

(Re)calculates and stores any bounds or bound-dependent data for this object.

At this abstraction level, this is only the world-space bounds stored in m_WorldBounds; subclasses may use this method to (re)compute additional bounds if necessary, or any data that depends on the bounds. Whenever bound-dependent data is requested through a public interface, RecalculateBoundsIfNecessary should be called first to ensure bound correctness, which will in turn call this method if it turns out that they're outdated.

See Also
m_BoundsValid
RecalculateBoundsIfNecessary

Implemented in CModelParticleEmitter, CModel, CModelDecal, and CPatch.

const CMatrix3D& CRenderableObject::GetInvTransform ( ) const
inline

Definition at line 83 of file RenderableObject.h.

CRenderData* CRenderableObject::GetRenderData ( )
inline

Return object renderdata - can be null if renderer hasn't yet created the renderdata.

Definition at line 126 of file RenderableObject.h.

const CMatrix3D& CRenderableObject::GetTransform ( ) const
inline

Definition at line 81 of file RenderableObject.h.

const CBoundingBoxAligned& CRenderableObject::GetWorldBounds ( )
inline

Returns the world-space axis-aligned bounds of this object.

Definition at line 105 of file RenderableObject.h.

virtual void CRenderableObject::InvalidateBounds ( )
inlinevirtual

Marks the bounds as invalid.

This will trigger RecalculateBoundsIfNecessary to recompute any bound-related data the next time any bound-related data is requested through a public interface – at least, if you've made sure to call it before returning the stored data.

Reimplemented in CModelAbstract.

Definition at line 116 of file RenderableObject.h.

CRenderableObject::NONCOPYABLE ( CRenderableObject  )
private
void CRenderableObject::RecalculateBoundsIfNecessary ( )
inlineprotected

Factored out so subclasses don't need to repeat this if they want to add additional getters for bounds-related methods (since they'll have to make sure to recalc the bounds if necessary before they return it).

Definition at line 131 of file RenderableObject.h.

void CRenderableObject::SetDirty ( u32  dirtyflags)
inline

Definition at line 87 of file RenderableObject.h.

void CRenderableObject::SetRenderData ( CRenderData renderdata)
inline

Definition at line 119 of file RenderableObject.h.

virtual void CRenderableObject::SetTransform ( const CMatrix3D transform)
inlinevirtual

Reimplemented in CModel, CModelParticleEmitter, and CModelDecal.

Definition at line 68 of file RenderableObject.h.

Member Data Documentation

bool CRenderableObject::m_BoundsValid
protected

Remembers whether any bounds need to be recalculated.

Subclasses that add any data that depends on the bounds should take care to consider the validity of the bounds and recalculate their data when necessary – overriding CalcBounds to do so would be a good idea, since it's already set up to be called by RecalculateBoundsIfNecessary whenever the bounds are marked as invalid. The latter should then be called before returning any bounds or bounds-derived data through a public interface (see the implementation of GetWorldBounds for an example).

See Also
CalcBounds
InvalidateBounds
RecalculateBoundsIfNecessary

Definition at line 160 of file RenderableObject.h.

CMatrix3D CRenderableObject::m_InvTransform
protected

Definition at line 145 of file RenderableObject.h.

CRenderData* CRenderableObject::m_RenderData
protected

Definition at line 147 of file RenderableObject.h.

CMatrix3D CRenderableObject::m_Transform
protected

Definition at line 143 of file RenderableObject.h.

CBoundingBoxAligned CRenderableObject::m_WorldBounds
protected

World-space bounds of this object.

Definition at line 141 of file RenderableObject.h.


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