Lugre::cGfx3D Class Reference

#include <lugre_gfx3D.h>

Inheritance diagram for Lugre::cGfx3D:

Inheritance graph
[legend]
Collaboration diagram for Lugre::cGfx3D:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void UpdateProjected (const int iFrameNum)
virtual ~cGfx3D ()
void Clear ()
 release attached objects
bool IsInScene ()
void SetParent (cGfx3D *pParent)
void SetParent (SceneNode *pParent)
Vector3 GetScale ()
Vector3 GetPosition ()
Vector3 GetDerivedPosition ()
Quaternion GetOrientation ()
Quaternion GetDerivedOrientation ()
void SetPosition (const Vector3 &vPos)
void SetOrientation (const Quaternion &qRot)
void SetScale (const Vector3 &vScale)
void SetNormaliseNormals (const bool bNormalise)
void SetVisible (const bool bVisible, const bool bCascade)
void SetCastShadows (const bool bCastShadows)
void SetMaterial (const char *szMat)
void SetPrepareFrameStep (const bool bOn)
void SetFastBatch ()
void SetParticleSystem (const char *szTemplateName)
const unsigned int GetNumParticles ()
void SetMesh (const char *szMeshName)
void SetManualObject (Ogre::ManualObject *pManualObject)
void SetBillboardSet (Ogre::BillboardSet *pBillboardSet)
void SetAnim (const char *szAnimName, const bool bLoop)
Real GetAnimLength (const char *szAnimName)
void SetPathAnimTimePos (const Real fTimeInSeconds)
Real GetPathAnimTimePos ()
bool IsPathAnimLooped ()
void SetAnimTimePos (const Real fTimeInSeconds)
Real GetAnimTimePos ()
bool IsAnimLooped ()
bool HasBone (const char *szBoneName)
void SetBillboard (const Vector3 vPos, const Real fRadius, const char *szMatName)
void SetExplosion (const Real fRadius, const char *szMatName)
void SetTargetTracker (const Real fDist, const Real fSize, const ColourValue vColor, const char *szMatName)
void SetRadar ()
void SetBeam (const bool bUseVertexColour)
void SetRadialGrid ()
void SetWireBoundingBox (const Ogre::AxisAlignedBox &aabb)
void SetWireBoundingBox (const Vector3 &vMin, const Vector3 &vMax)
void SetWireBoundingBox (Ogre::MovableObject &mov)
void SetWireBoundingBox (Ogre::Entity &entity)
void SetWireBoundingBox (cGfx3D &gfx3D)
void SetSimpleRenderable ()
 general renderable, must be filled before being drawn, otherwise it will crash !
void SetTextFont (const char *szFontName)
 text is not automatically update, call SetText again for change to take effekt
void SetText (const char *szText, const Real fSize, const ColourValue vColor, const float mfWrapMaxW=0, Ogre::GuiHorizontalAlignment align=Ogre::GHA_LEFT)
 use SetTextFont before this !
void CreateMergedMesh (const char *szMeshname)
void SetTrail (const Vector3 vPos, const Real fLength, const unsigned int iElements, const char *szMatName, const Real fR, const Real fG, const Real fB, const Real fA, const Real fDeltaR, const Real fDeltaG, const Real fDeltaB, const Real fDeltaA, const Real fW, const Real fDeltaW)
void SetStarfield (const size_t numstars, const Real fRad, const Real fColoring, const char *szMatName)
 fColoring is in [0;1] 0 means gray, 1 means full color
void AttachObject (Ogre::MovableObject *pObj)
void DetachObject (Ogre::MovableObject *pObj)
void DestroyPath ()

Static Public Member Functions

static cGfx3DNewOfSceneNode (Ogre::SceneNode *pParent)
static cGfx3DNewChildOfSceneNode (Ogre::SceneNode *pParent)
static cGfx3DNewChildOfGfx3D (cGfx3D *pParent)
static cGfx3DNewChildOfRoot (Ogre::SceneManager *pSceneMgr)
 create a child of the root scene node
static cGfx3DNewFree (Ogre::SceneManager *pSceneMgr)
 create a free node, not attached to the scenegraph yet
static cGfx3DNewTagPoint (cGfx3D *pParent, const char *szBoneName, const Ogre::Vector3 &vOffsetPosition=Ogre::Vector3::ZERO, const Ogre::Quaternion &qOffsetOrientation=Ogre::Quaternion::IDENTITY)
static void LuaRegister (lua_State *L)
 lua binding
static void PrepareFrame ()
 called immediately before rendering each frame

Public Attributes

SceneNode * mpSceneNode
TagPoint * mpTagPoint
cFastBatchmpFastBatch
cRadialGridmpRadialGrid
cRadarmpRadar
Ogre::RibbonTrail * mpTrail
cSimpleBeammpBeam
Ogre::Entity * mpEntity
Ogre::Entity * mpAttachToEntity
std::string msAttachToBoneName
Ogre::AnimationState * mpAnimState
Ogre::String msPathAnimName
Ogre::AnimationState * mpPathAnimState
bool mbHasPath
Ogre::BillboardSet * mpBillboardSet
Ogre::ParticleSystem * mpParticleSystem
Ogre::ManualObject * mpManualObject
Ogre::FontPtr mpFont
cRobSimpleRenderablempSimpleRenderable
Ogre::AxisAlignedBox mAABB
 only for mpWireBoundingBoxRenderable mousepicking
float mfCustomBoundingRadius
 used for 2D-tracking in gfx2D
bool mbHasAABB
Ogre::Camera * mpForcePosCam
 update the position of this gfx to match the cam, needs PrepareFrameStep
Ogre::Camera * mpForceRotCam
 update the rotation of this gfx to match the cam, needs PrepareFrameStep
cSmartPtr< cGfx3DmpForceLookatTarget
 update the rotation of this gfx to look at the specified scenenode, needs PrepareFrameStep
Ogre::Vector3 mvProjectedPos
Ogre::Vector3 mvProjectedSize
 used by gfx2d hud-elements
int miLastProjectedFrame
 rembers frameid

Static Public Attributes

static unsigned int miCount = 0

Private Member Functions

 cGfx3D (SceneNode *pSceneNode)
 don't call this directly, use the static cGfx3D::New* methods instead
void PrepareFrameStep ()
 handles stuff that has to be done every frame, right before rendering, e.g. billbord orientation

Private Attributes

std::list< cGfx3D * >::iterator mPrepareFrameItor
 points to self, for constant time removal
bool mbPrepareFrameStep
 true if PrepareFrameStep should be called every frame, dont change manually, use SetPrepareFrameStep

Static Private Attributes

static std::list< cGfx3D * > gPrepareFrameStepper


Detailed Description

Definition at line 69 of file lugre_gfx3D.h.


Constructor & Destructor Documentation

Lugre::cGfx3D::cGfx3D ( SceneNode *  pSceneNode  )  [private]

don't call this directly, use the static cGfx3D::New* methods instead

Definition at line 542 of file lugre_gfx3D.cpp.

References miCount.

Referenced by NewChildOfSceneNode(), NewFree(), NewOfSceneNode(), and NewTagPoint().

Lugre::cGfx3D::~cGfx3D (  )  [virtual]


Member Function Documentation

void Lugre::cGfx3D::UpdateProjected ( const int  iFrameNum  ) 

cGfx3D * Lugre::cGfx3D::NewOfSceneNode ( Ogre::SceneNode *  pParent  )  [static]

Definition at line 527 of file lugre_gfx3D.cpp.

References assert, and cGfx3D().

cGfx3D * Lugre::cGfx3D::NewChildOfSceneNode ( Ogre::SceneNode *  pParent  )  [static]

cGfx3D * Lugre::cGfx3D::NewChildOfGfx3D ( cGfx3D pParent  )  [static]

Definition at line 529 of file lugre_gfx3D.cpp.

References assert, mpSceneNode, and NewChildOfSceneNode().

Referenced by Lugre::cGfx3D_L::CreateChild().

cGfx3D * Lugre::cGfx3D::NewChildOfRoot ( Ogre::SceneManager *  pSceneMgr  )  [static]

create a child of the root scene node

Definition at line 530 of file lugre_gfx3D.cpp.

References assert, and NewChildOfSceneNode().

Referenced by Lugre::cGfx3D_L::CreateRootGfx3D().

cGfx3D * Lugre::cGfx3D::NewFree ( Ogre::SceneManager *  pSceneMgr  )  [static]

create a free node, not attached to the scenegraph yet

Definition at line 531 of file lugre_gfx3D.cpp.

References assert, cGfx3D(), Lugre::cOgreWrapper::GetSingleton(), and Lugre::cOgreWrapper::GetUniqueName().

Referenced by Lugre::cGfx3D_L::CreateGfx3D().

cGfx3D * Lugre::cGfx3D::NewTagPoint ( cGfx3D pParent,
const char *  szBoneName,
const Ogre::Vector3 &  vOffsetPosition = Ogre::Vector3::ZERO,
const Ogre::Quaternion &  qOffsetOrientation = Ogre::Quaternion::IDENTITY 
) [static]

Definition at line 532 of file lugre_gfx3D.cpp.

References assert, cGfx3D(), mpAttachToEntity, mpEntity, and msAttachToBoneName.

Referenced by Lugre::cGfx3D_L::CreateTagPoint().

void Lugre::cGfx3D::Clear (  ) 

bool Lugre::cGfx3D::IsInScene (  ) 

Definition at line 617 of file lugre_gfx3D.cpp.

References mpSceneNode.

void Lugre::cGfx3D::SetParent ( cGfx3D pParent  ) 

Definition at line 620 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

void Lugre::cGfx3D::SetParent ( SceneNode *  pParent  ) 

Definition at line 621 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Vector3 Lugre::cGfx3D::GetScale (  ) 

Definition at line 628 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Vector3 Lugre::cGfx3D::GetPosition (  ) 

Definition at line 629 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Referenced by SetWireBoundingBox().

Vector3 Lugre::cGfx3D::GetDerivedPosition (  ) 

Definition at line 630 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Quaternion Lugre::cGfx3D::GetOrientation (  ) 

Definition at line 631 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Quaternion Lugre::cGfx3D::GetDerivedOrientation (  ) 

Definition at line 632 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

void Lugre::cGfx3D::SetPosition ( const Vector3 &  vPos  ) 

Definition at line 634 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Referenced by PrepareFrameStep(), SetWireBoundingBox(), and cObject::Step().

void Lugre::cGfx3D::SetOrientation ( const Quaternion &  qRot  ) 

Definition at line 637 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

Referenced by PrepareFrameStep(), and cObject::Step().

void Lugre::cGfx3D::SetScale ( const Vector3 &  vScale  ) 

Definition at line 635 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

void Lugre::cGfx3D::SetNormaliseNormals ( const bool  bNormalise  ) 

Definition at line 636 of file lugre_gfx3D.cpp.

References PROFILE.

void Lugre::cGfx3D::SetVisible ( const bool  bVisible,
const bool  bCascade 
)

Definition at line 638 of file lugre_gfx3D.cpp.

References mpSceneNode, and PROFILE.

void Lugre::cGfx3D::SetCastShadows ( const bool  bCastShadows  ) 

Definition at line 639 of file lugre_gfx3D.cpp.

References mpBeam, mpEntity, mpFastBatch, mpManualObject, mpSimpleRenderable, and PROFILE.

void Lugre::cGfx3D::SetMaterial ( const char *  szMat  ) 

Definition at line 646 of file lugre_gfx3D.cpp.

References mpBeam, mpBillboardSet, mpSimpleRenderable, and PROFILE.

void Lugre::cGfx3D::SetPrepareFrameStep ( const bool  bOn  ) 

Definition at line 479 of file lugre_gfx3D.cpp.

References assert, gPrepareFrameStepper, mbPrepareFrameStep, and mPrepareFrameItor.

Referenced by Clear().

void Lugre::cGfx3D::SetFastBatch (  ) 

Definition at line 958 of file lugre_gfx3D.cpp.

References AttachObject(), Clear(), mpFastBatch, and mpSceneNode.

void Lugre::cGfx3D::SetParticleSystem ( const char *  szTemplateName  ) 

const unsigned int Lugre::cGfx3D::GetNumParticles (  ) 

Definition at line 667 of file lugre_gfx3D.cpp.

References mpParticleSystem, mpSceneNode, and PROFILE.

void Lugre::cGfx3D::SetMesh ( const char *  szMeshName  ) 

void Lugre::cGfx3D::SetManualObject ( Ogre::ManualObject *  pManualObject  ) 

Definition at line 675 of file lugre_gfx3D.cpp.

References AttachObject(), Clear(), and mpManualObject.

void Lugre::cGfx3D::SetBillboardSet ( Ogre::BillboardSet *  pBillboardSet  ) 

Definition at line 682 of file lugre_gfx3D.cpp.

References AttachObject(), Clear(), and mpBillboardSet.

void Lugre::cGfx3D::SetAnim ( const char *  szAnimName,
const bool  bLoop 
)

Definition at line 700 of file lugre_gfx3D.cpp.

References mpAnimState, and mpEntity.

Real Lugre::cGfx3D::GetAnimLength ( const char *  szAnimName  ) 

Definition at line 713 of file lugre_gfx3D.cpp.

References mpEntity.

void Lugre::cGfx3D::SetPathAnimTimePos ( const Real  fTimeInSeconds  ) 

Definition at line 725 of file lugre_gfx3D.cpp.

References mpPathAnimState.

Real Lugre::cGfx3D::GetPathAnimTimePos (  ) 

Definition at line 726 of file lugre_gfx3D.cpp.

References mpPathAnimState.

bool Lugre::cGfx3D::IsPathAnimLooped (  ) 

Definition at line 727 of file lugre_gfx3D.cpp.

References mpPathAnimState.

void Lugre::cGfx3D::SetAnimTimePos ( const Real  fTimeInSeconds  ) 

Definition at line 721 of file lugre_gfx3D.cpp.

References mpAnimState.

Real Lugre::cGfx3D::GetAnimTimePos (  ) 

Definition at line 722 of file lugre_gfx3D.cpp.

References mpAnimState.

bool Lugre::cGfx3D::IsAnimLooped (  ) 

Definition at line 723 of file lugre_gfx3D.cpp.

References mpAnimState.

bool Lugre::cGfx3D::HasBone ( const char *  szBoneName  ) 

Definition at line 729 of file lugre_gfx3D.cpp.

References mpEntity, and Lugre::cOgreWrapper::SearchBoneByName().

void Lugre::cGfx3D::SetBillboard ( const Vector3  vPos,
const Real  fRadius,
const char *  szMatName 
)

void Lugre::cGfx3D::SetExplosion ( const Real  fRadius,
const char *  szMatName 
)

Definition at line 1035 of file lugre_gfx3D.cpp.

References PROFILE, and SetBillboard().

void Lugre::cGfx3D::SetTargetTracker ( const Real  fDist,
const Real  fSize,
const ColourValue  vColor,
const char *  szMatName 
)

Definition at line 1028 of file lugre_gfx3D.cpp.

References AttachObject(), mpSceneNode, and PROFILE.

void Lugre::cGfx3D::SetRadar (  ) 

void Lugre::cGfx3D::SetBeam ( const bool  bUseVertexColour  ) 

void Lugre::cGfx3D::SetRadialGrid (  ) 

void Lugre::cGfx3D::SetWireBoundingBox ( const Ogre::AxisAlignedBox &  aabb  ) 

void Lugre::cGfx3D::SetWireBoundingBox ( const Vector3 &  vMin,
const Vector3 &  vMax 
)

Definition at line 792 of file lugre_gfx3D.cpp.

References SetWireBoundingBox().

void Lugre::cGfx3D::SetWireBoundingBox ( Ogre::MovableObject &  mov  ) 

Definition at line 798 of file lugre_gfx3D.cpp.

References SetWireBoundingBox().

void Lugre::cGfx3D::SetWireBoundingBox ( Ogre::Entity &  entity  ) 

void Lugre::cGfx3D::SetWireBoundingBox ( cGfx3D gfx3D  ) 

Definition at line 811 of file lugre_gfx3D.cpp.

References GetPosition(), mAABB, mbHasAABB, mpEntity, SetPosition(), and SetWireBoundingBox().

void Lugre::cGfx3D::SetSimpleRenderable (  ) 

general renderable, must be filled before being drawn, otherwise it will crash !

Definition at line 822 of file lugre_gfx3D.cpp.

References AttachObject(), mpSceneNode, and mpSimpleRenderable.

void Lugre::cGfx3D::SetTextFont ( const char *  szFontName  ) 

text is not automatically update, call SetText again for change to take effekt

Definition at line 831 of file lugre_gfx3D.cpp.

References AttachObject(), Lugre::cOgreWrapper::GetSingleton(), mpFont, and mpSimpleRenderable.

void Lugre::cGfx3D::SetText ( const char *  szText,
const Real  fSize,
const ColourValue  vColor,
const float  mfWrapMaxW = 0,
Ogre::GuiHorizontalAlignment  align = Ogre::GHA_LEFT 
)

void Lugre::cGfx3D::CreateMergedMesh ( const char *  szMeshname  ) 

void Lugre::cGfx3D::SetTrail ( const Vector3  vPos,
const Real  fLength,
const unsigned int  iElements,
const char *  szMatName,
const Real  fR,
const Real  fG,
const Real  fB,
const Real  fA,
const Real  fDeltaR,
const Real  fDeltaG,
const Real  fDeltaB,
const Real  fDeltaA,
const Real  fW,
const Real  fDeltaW 
)

void Lugre::cGfx3D::SetStarfield ( const size_t  numstars,
const Real  fRad,
const Real  fColoring,
const char *  szMatName 
)

fColoring is in [0;1] 0 means gray, 1 means full color

Definition at line 967 of file lugre_gfx3D.cpp.

References AttachObject(), Lugre::cRobRenderOp::Begin(), Lugre::cRobRenderOp::End(), mpSceneNode, PROFILE, and Lugre::cRobRenderOp::Vertex().

void Lugre::cGfx3D::LuaRegister ( lua_State *  L  )  [static]

lua binding

Definition at line 1226 of file lugre_gfx3D_L.cpp.

References PROFILE.

void Lugre::cGfx3D::AttachObject ( Ogre::MovableObject *  pObj  ) 

void Lugre::cGfx3D::DetachObject ( Ogre::MovableObject *  pObj  ) 

Definition at line 1046 of file lugre_gfx3D.cpp.

References mpAttachToEntity, and mpSceneNode.

void Lugre::cGfx3D::DestroyPath (  ) 

void Lugre::cGfx3D::PrepareFrameStep (  )  [private]

handles stuff that has to be done every frame, right before rendering, e.g. billbord orientation

Definition at line 499 of file lugre_gfx3D.cpp.

References mpForcePosCam, mpForceRotCam, mpSceneNode, SetOrientation(), and SetPosition().

Referenced by PrepareFrame().

void Lugre::cGfx3D::PrepareFrame (  )  [static]

called immediately before rendering each frame

Definition at line 494 of file lugre_gfx3D.cpp.

References gPrepareFrameStepper, and PrepareFrameStep().

Referenced by Lugre::cGame::RenderOneFrame().


Member Data Documentation

unsigned int Lugre::cGfx3D::miCount = 0 [static]

Definition at line 70 of file lugre_gfx3D.h.

Referenced by cGfx3D(), Lugre::cGfx3D_L::GetGfx3DCount(), and ~cGfx3D().

Definition at line 74 of file lugre_gfx3D.h.

Referenced by AttachObject().

Definition at line 75 of file lugre_gfx3D.h.

Referenced by Clear(), SetCastShadows(), and SetFastBatch().

Definition at line 76 of file lugre_gfx3D.h.

Referenced by Clear(), and SetRadialGrid().

Definition at line 77 of file lugre_gfx3D.h.

Referenced by Clear(), and SetRadar().

Ogre::RibbonTrail* Lugre::cGfx3D::mpTrail

Definition at line 78 of file lugre_gfx3D.h.

Referenced by Clear(), and SetTrail().

Definition at line 79 of file lugre_gfx3D.h.

Referenced by Clear(), SetBeam(), SetCastShadows(), and SetMaterial().

Ogre::Entity* Lugre::cGfx3D::mpEntity

Definition at line 81 of file lugre_gfx3D.h.

Referenced by AttachObject(), DetachObject(), and NewTagPoint().

Definition at line 82 of file lugre_gfx3D.h.

Referenced by AttachObject(), and NewTagPoint().

Ogre::AnimationState* Lugre::cGfx3D::mpAnimState

Definition at line 83 of file lugre_gfx3D.h.

Referenced by GetAnimTimePos(), IsAnimLooped(), SetAnim(), and SetAnimTimePos().

Definition at line 84 of file lugre_gfx3D.h.

Referenced by DestroyPath().

Ogre::AnimationState* Lugre::cGfx3D::mpPathAnimState

Definition at line 86 of file lugre_gfx3D.h.

Referenced by DestroyPath().

Ogre::BillboardSet* Lugre::cGfx3D::mpBillboardSet

Definition at line 87 of file lugre_gfx3D.h.

Referenced by SetBillboard(), SetBillboardSet(), and SetMaterial().

Ogre::ParticleSystem* Lugre::cGfx3D::mpParticleSystem

Definition at line 88 of file lugre_gfx3D.h.

Referenced by Clear(), GetNumParticles(), and SetParticleSystem().

Ogre::ManualObject* Lugre::cGfx3D::mpManualObject

Definition at line 89 of file lugre_gfx3D.h.

Referenced by Clear(), SetCastShadows(), and SetManualObject().

Ogre::FontPtr Lugre::cGfx3D::mpFont

Definition at line 90 of file lugre_gfx3D.h.

Referenced by SetText(), and SetTextFont().

Ogre::AxisAlignedBox Lugre::cGfx3D::mAABB

only for mpWireBoundingBoxRenderable mousepicking

Definition at line 93 of file lugre_gfx3D.h.

Referenced by SetWireBoundingBox().

used for 2D-tracking in gfx2D

Definition at line 94 of file lugre_gfx3D.h.

Referenced by cObject::Step(), and UpdateProjected().

Definition at line 95 of file lugre_gfx3D.h.

Referenced by SetWireBoundingBox().

update the position of this gfx to match the cam, needs PrepareFrameStep

Definition at line 96 of file lugre_gfx3D.h.

Referenced by PrepareFrameStep().

update the rotation of this gfx to match the cam, needs PrepareFrameStep

Definition at line 97 of file lugre_gfx3D.h.

Referenced by PrepareFrameStep().

update the rotation of this gfx to look at the specified scenenode, needs PrepareFrameStep

Definition at line 98 of file lugre_gfx3D.h.

Definition at line 99 of file lugre_gfx3D.h.

Referenced by Lugre::cGfx2D::PrepareFrameStep(), and UpdateProjected().

used by gfx2d hud-elements

Definition at line 99 of file lugre_gfx3D.h.

Referenced by Lugre::cGfx2D::PrepareFrameStep(), and UpdateProjected().

rembers frameid

Definition at line 100 of file lugre_gfx3D.h.

Referenced by UpdateProjected().

std::list< cGfx3D * > Lugre::cGfx3D::gPrepareFrameStepper [static, private]

Definition at line 184 of file lugre_gfx3D.h.

Referenced by PrepareFrame(), and SetPrepareFrameStep().

std::list<cGfx3D*>::iterator Lugre::cGfx3D::mPrepareFrameItor [private]

points to self, for constant time removal

Definition at line 185 of file lugre_gfx3D.h.

Referenced by SetPrepareFrameStep().

true if PrepareFrameStep should be called every frame, dont change manually, use SetPrepareFrameStep

Definition at line 186 of file lugre_gfx3D.h.

Referenced by SetPrepareFrameStep().


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

Generated on Sat Jul 31 06:00:11 2010 for cpp by  doxygen 1.5.6