Project

General

Profile

SO3Engine

For viewing the Newton rigid bodies visually. More...

#include <OgreNewt_Debugger.h>

Inheritance diagram for OgreNewt::Debugger:

Classes

struct  BodyDebugData
 

Public Member Functions

 ~Debugger ()
 
void init (Ogre::SceneManager *smgr)
 init the debugger.
 
void deInit ()
 de-init the debugger (cleantup)
 
virtual void nodeDestroyed (const Ogre::Node *)
 called when one of the nodes used in this class are destroyed
 
void showDebugInformation ()
 show the newton world
 
void hideDebugInformation ()
 remove lines and text drawn
 
void setDefaultColor (Ogre::ColourValue col)
 set default color
 
void setMaterialColor (const MaterialID *mat, Ogre::ColourValue col)
 set Material color
 
void startRaycastRecording (bool markhitbodies=false)
 enable additional raycast-debugging (this also enables displaying of recorded raycasts!)
 
bool isRaycastRecording ()
 returns true, if currently recording raycasts
 
bool isRaycastRecordingHitBodies ()
 returns true, if hit bodies are currently recording
 
void clearRaycastsRecorded ()
 clears all raycasts, that are currently shown, should probably be done once per frame!
 
void stopRaycastRecording ()
 disables raycast-debugging
 
void setRaycastRecordingColor (Ogre::ColourValue rayCol, Ogre::ColourValue convexCol, Ogre::ColourValue hitBodyCol, Ogre::ColourValue prefilterDiscardedBodyCol)
 set the color of the raycast-debug-lines
 
void addRay (const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt)
 this function is used internally
 
void addConvexRay (const OgreNewt::ConvexCollisionPtr &col, const Ogre::Vector3 &startpt, const Ogre::Quaternion &colori, const Ogre::Vector3 &endpt)
 this function is used internally
 
void addDiscardedBody (const OgreNewt::Body *body)
 this function is used internally
 
void addHitBody (const OgreNewt::Body *body)
 this function is used internally
 
void buildDebugObjectFromCollision (Ogre::ManualObject *object, Ogre::ColourValue colour, const NewtonCollision *shape) const
 

Protected Types

typedef std::map< int, Ogre::ColourValue > MaterialIdColorMap
 
typedef std::map< OgreNewt::Body *, BodyDebugDataBodyDebugDataMap
 
typedef std::list< Ogre::ManualObject * > ManualObjectList
 

Protected Member Functions

 Debugger (const OgreNewt::World *world)
 this function must only be used by an instance of the OgreNewt::World class
 
void processBody (Body *body)
 create debug information for one body
 
void processJoint (Joint *joint)
 call the function to show debug information for this joint
 
void clearBodyDebugDataCache ()
 clear debug data cache for bodies (m_cachemap)
 

Protected Attributes

const OgreNewt::Worldm_world
 
Ogre::SceneManager * m_sceneManager
 
Ogre::SceneNode * m_debugnode
 
MaterialIdColorMap m_materialcolors
 
Ogre::ColourValue m_defaultcolor
 
Ogre::SceneNode * m_raycastsnode
 
bool m_recordraycasts
 
Ogre::ColourValue m_raycol
 
Ogre::ColourValue m_convexcol
 
Ogre::ColourValue m_hitbodycol
 
Ogre::ColourValue m_prefilterdiscardedcol
 
bool m_markhitbodies
 
BodyDebugDataMap m_cachemap
 
ManualObjectList mRecordedRaycastObjects
 

Friends

class OgreNewt::World
 

Detailed Description

For viewing the Newton rigid bodies visually.

This class implements a debug view of the Newton world. You can access it via World::getDebugger(). It needs to be initialized (call World::getDebugger().init(...)).

Definition at line 34 of file OgreNewt_Debugger.h.

Member Typedef Documentation

◆ BodyDebugDataMap

Definition at line 132 of file OgreNewt_Debugger.h.

◆ ManualObjectList

typedef std::list<Ogre::ManualObject*> OgreNewt::Debugger::ManualObjectList
protected

Definition at line 144 of file OgreNewt_Debugger.h.

◆ MaterialIdColorMap

typedef std::map<int, Ogre::ColourValue> OgreNewt::Debugger::MaterialIdColorMap
protected

Definition at line 108 of file OgreNewt_Debugger.h.

Constructor & Destructor Documentation

◆ ~Debugger()

OgreNewt::Debugger::~Debugger ( )

Definition at line 36 of file OgreNewt_Debugger.cpp.

◆ Debugger()

OgreNewt::Debugger::Debugger ( const OgreNewt::World world)
protected

this function must only be used by an instance of the OgreNewt::World class

Definition at line 21 of file OgreNewt_Debugger.cpp.

Member Function Documentation

◆ addConvexRay()

void OgreNewt::Debugger::addConvexRay ( const OgreNewt::ConvexCollisionPtr col,
const Ogre::Vector3 &  startpt,
const Ogre::Quaternion &  colori,
const Ogre::Vector3 &  endpt 
)

this function is used internally

Definition at line 388 of file OgreNewt_Debugger.cpp.

◆ addDiscardedBody()

void OgreNewt::Debugger::addDiscardedBody ( const OgreNewt::Body body)

this function is used internally

Definition at line 446 of file OgreNewt_Debugger.cpp.

◆ addHitBody()

void OgreNewt::Debugger::addHitBody ( const OgreNewt::Body body)

this function is used internally

Definition at line 474 of file OgreNewt_Debugger.cpp.

◆ addRay()

void OgreNewt::Debugger::addRay ( const Ogre::Vector3 &  startpt,
const Ogre::Vector3 &  endpt 
)

this function is used internally

Definition at line 367 of file OgreNewt_Debugger.cpp.

◆ buildDebugObjectFromCollision()

void OgreNewt::Debugger::buildDebugObjectFromCollision ( Ogre::ManualObject *  object,
Ogre::ColourValue  colour,
const NewtonCollision *  shape 
) const

Definition at line 181 of file OgreNewt_Debugger.cpp.

◆ clearBodyDebugDataCache()

void OgreNewt::Debugger::clearBodyDebugDataCache ( )
protected

clear debug data cache for bodies (m_cachemap)

Definition at line 96 of file OgreNewt_Debugger.cpp.

◆ clearRaycastsRecorded()

void OgreNewt::Debugger::clearRaycastsRecorded ( )

clears all raycasts, that are currently shown, should probably be done once per frame!

Definition at line 334 of file OgreNewt_Debugger.cpp.

◆ deInit()

void OgreNewt::Debugger::deInit ( )

de-init the debugger (cleantup)

Definition at line 58 of file OgreNewt_Debugger.cpp.

◆ hideDebugInformation()

void OgreNewt::Debugger::hideDebugInformation ( )

remove lines and text drawn

Definition at line 147 of file OgreNewt_Debugger.cpp.

◆ init()

void OgreNewt::Debugger::init ( Ogre::SceneManager *  smgr)

init the debugger.

Definition at line 41 of file OgreNewt_Debugger.cpp.

◆ isRaycastRecording()

bool OgreNewt::Debugger::isRaycastRecording ( )

returns true, if currently recording raycasts

Definition at line 324 of file OgreNewt_Debugger.cpp.

◆ isRaycastRecordingHitBodies()

bool OgreNewt::Debugger::isRaycastRecordingHitBodies ( )

returns true, if hit bodies are currently recording

Definition at line 329 of file OgreNewt_Debugger.cpp.

◆ nodeDestroyed()

void OgreNewt::Debugger::nodeDestroyed ( const Ogre::Node *  node)
virtual

called when one of the nodes used in this class are destroyed

Definition at line 80 of file OgreNewt_Debugger.cpp.

◆ processBody()

void OgreNewt::Debugger::processBody ( OgreNewt::Body bod)
protected

create debug information for one body

Definition at line 202 of file OgreNewt_Debugger.cpp.

◆ processJoint()

void OgreNewt::Debugger::processJoint ( Joint joint)
protected

call the function to show debug information for this joint

Definition at line 174 of file OgreNewt_Debugger.cpp.

◆ setDefaultColor()

void OgreNewt::Debugger::setDefaultColor ( Ogre::ColourValue  col)

set default color

Definition at line 159 of file OgreNewt_Debugger.cpp.

◆ setMaterialColor()

void OgreNewt::Debugger::setMaterialColor ( const MaterialID mat,
Ogre::ColourValue  col 
)

set Material color

Definition at line 154 of file OgreNewt_Debugger.cpp.

◆ setRaycastRecordingColor()

void OgreNewt::Debugger::setRaycastRecordingColor ( Ogre::ColourValue  rayCol,
Ogre::ColourValue  convexCol,
Ogre::ColourValue  hitBodyCol,
Ogre::ColourValue  prefilterDiscardedBodyCol 
)

set the color of the raycast-debug-lines

Definition at line 359 of file OgreNewt_Debugger.cpp.

◆ showDebugInformation()

void OgreNewt::Debugger::showDebugInformation ( )

show the newton world

Draws the Newton world as 3D lines with informative text above each body

Definition at line 112 of file OgreNewt_Debugger.cpp.

◆ startRaycastRecording()

void OgreNewt::Debugger::startRaycastRecording ( bool  markhitbodies = false)

enable additional raycast-debugging (this also enables displaying of recorded raycasts!)

Definition at line 318 of file OgreNewt_Debugger.cpp.

◆ stopRaycastRecording()

void OgreNewt::Debugger::stopRaycastRecording ( )

disables raycast-debugging

Definition at line 354 of file OgreNewt_Debugger.cpp.

Friends And Related Symbol Documentation

◆ OgreNewt::World

friend class OgreNewt::World
friend

Definition at line 101 of file OgreNewt_Debugger.h.

Member Data Documentation

◆ m_cachemap

BodyDebugDataMap OgreNewt::Debugger::m_cachemap
protected

Definition at line 133 of file OgreNewt_Debugger.h.

◆ m_convexcol

Ogre::ColourValue OgreNewt::Debugger::m_convexcol
protected

Definition at line 115 of file OgreNewt_Debugger.h.

◆ m_debugnode

Ogre::SceneNode* OgreNewt::Debugger::m_debugnode
protected

Definition at line 107 of file OgreNewt_Debugger.h.

◆ m_defaultcolor

Ogre::ColourValue OgreNewt::Debugger::m_defaultcolor
protected

Definition at line 110 of file OgreNewt_Debugger.h.

◆ m_hitbodycol

Ogre::ColourValue OgreNewt::Debugger::m_hitbodycol
protected

Definition at line 115 of file OgreNewt_Debugger.h.

◆ m_markhitbodies

bool OgreNewt::Debugger::m_markhitbodies
protected

Definition at line 116 of file OgreNewt_Debugger.h.

◆ m_materialcolors

MaterialIdColorMap OgreNewt::Debugger::m_materialcolors
protected

Definition at line 109 of file OgreNewt_Debugger.h.

◆ m_prefilterdiscardedcol

Ogre::ColourValue OgreNewt::Debugger::m_prefilterdiscardedcol
protected

Definition at line 115 of file OgreNewt_Debugger.h.

◆ m_raycastsnode

Ogre::SceneNode* OgreNewt::Debugger::m_raycastsnode
protected

Definition at line 113 of file OgreNewt_Debugger.h.

◆ m_raycol

Ogre::ColourValue OgreNewt::Debugger::m_raycol
protected

Definition at line 115 of file OgreNewt_Debugger.h.

◆ m_recordraycasts

bool OgreNewt::Debugger::m_recordraycasts
protected

Definition at line 114 of file OgreNewt_Debugger.h.

◆ m_sceneManager

Ogre::SceneManager* OgreNewt::Debugger::m_sceneManager
protected

Definition at line 106 of file OgreNewt_Debugger.h.

◆ m_world

const OgreNewt::World* OgreNewt::Debugger::m_world
protected

Definition at line 105 of file OgreNewt_Debugger.h.

◆ mRecordedRaycastObjects

ManualObjectList OgreNewt::Debugger::mRecordedRaycastObjects
protected

Definition at line 145 of file OgreNewt_Debugger.h.


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