SO3Engine
|
OgreNewt_Debugger.cpp
Go to the documentation of this file.
51 m_raycastsnode = smgr->getRootSceneNode()->createChildSceneNode("__OgreNewt__Raycasts_Debugger__Node__");
181 void Debugger::buildDebugObjectFromCollision(Ogre::ManualObject* object, Ogre::ColourValue colour, const NewtonCollision* shape) const
205 MaterialIdColorMap::iterator it = m_materialcolors.find(NewtonBodyGetMaterialGroupID(newtonBody));
229 oss_info << "Inertia: " << inertia[0] << " x " << inertia[1] << " x " << inertia[2] << std::endl;
236 if (data->m_lastcol == bod->getCollision() && (data->m_scale == bod->getOgreNode()->_getDerivedScale())) // use cached data
274 data->m_text->setLocalTranslation(bod->getAABB().getMaximum().y * 1.01f * Ogre::Vector3::UNIT_Y);
278 data->m_text = new OgreNewt::OgreAddons::MovableText(oss_name.str(), oss_info.str(), "BlueHighway-10", bod->getAABB().getSize().y * 0.1f);
279 data->m_text->setLocalTranslation(bod->getAABB().getMaximum().y * 1.01f * Ogre::Vector3::UNIT_Y);
280 data->m_text->setTextAlignment(OgreNewt::OgreAddons::MovableText::H_LEFT, OgreNewt::OgreAddons::MovableText::V_ABOVE);
285 buildDebugObjectFromCollision(data->m_lines, m_defaultcolor, NewtonBodyGetCollision(bod->getNewtonBody()));
294 void _CDECL Debugger::newtonPerPoly(void* userData, int vertexCount, const dFloat* faceVertec, int id)
347 for (ManualObjectList::iterator it = mRecordedRaycastObjects.begin(); it != mRecordedRaycastObjects.end(); it++)
359 void Debugger::setRaycastRecordingColor(Ogre::ColourValue rayCol, Ogre::ColourValue convexCol, Ogre::ColourValue hitBodyCol, Ogre::ColourValue prefilterDiscardedBodyCol)
388 void Debugger::addConvexRay(const OgreNewt::ConvexCollisionPtr& col, const Ogre::Vector3 &startpt, const Ogre::Quaternion &colori, const Ogre::Vector3 &endpt)
465 NewtonCollisionForEachPolygonDo(body->getCollision()->getNewtonCollision(), &matrix[0], newtonPerPoly, line);
493 NewtonCollisionForEachPolygonDo(body->getCollision()->getNewtonCollision(), &matrix[0], newtonPerPoly, line);
void getMassMatrix(Ogre::Real &mass, Ogre::Vector3 &inertia) const
get Ogre::Real(mass) and Ogre::Vector3(inertia) of the body.
Definition OgreNewt_Body.cpp:487
const OgreNewt::CollisionPtr & getCollision() const
set the factors that cause a body to "freeze" when equilibrium reached.
Definition OgreNewt_Body.cpp:393
Ogre::Vector3 getVelocity() const
get velocity of the body. in global coordinates.
Definition OgreNewt_Body.cpp:548
Ogre::Vector3 getOmega() const
get omega of the body. in global space.
Definition OgreNewt_Body.cpp:533
NewtonBody * getNewtonBody() const
get a pointer to the NewtonBody object
Definition OgreNewt_Body.h:127
Ogre::AxisAlignedBox getAABB() const
get the axis-aligned bounding box for this body.
Definition OgreNewt_Body.cpp:465
void getVisualPositionOrientation(Ogre::Vector3 &pos, Ogre::Quaternion &orient) const
get the node position and orientation in form of an Ogre::Vector(position) and Ogre::Quaternion(orien...
Definition OgreNewt_Body.cpp:448
NewtonCollision *const getNewtonCollision() const
retrieve the Newton pointer
Definition OgreNewt_Collision.h:70
represents a collision shape that is explicitly convex.
Definition OgreNewt_Collision.h:121
virtual void nodeDestroyed(const Ogre::Node *)
called when one of the nodes used in this class are destroyed
Definition OgreNewt_Debugger.cpp:80
bool isRaycastRecording()
returns true, if currently recording raycasts
Definition OgreNewt_Debugger.cpp:324
void setRaycastRecordingColor(Ogre::ColourValue rayCol, Ogre::ColourValue convexCol, Ogre::ColourValue hitBodyCol, Ogre::ColourValue prefilterDiscardedBodyCol)
set the color of the raycast-debug-lines
Definition OgreNewt_Debugger.cpp:359
MaterialIdColorMap m_materialcolors
Definition OgreNewt_Debugger.h:109
void buildDebugObjectFromCollision(Ogre::ManualObject *object, Ogre::ColourValue colour, const NewtonCollision *shape) const
Definition OgreNewt_Debugger.cpp:181
bool isRaycastRecordingHitBodies()
returns true, if hit bodies are currently recording
Definition OgreNewt_Debugger.cpp:329
void addHitBody(const OgreNewt::Body *body)
this function is used internally
Definition OgreNewt_Debugger.cpp:474
Ogre::ColourValue m_defaultcolor
Definition OgreNewt_Debugger.h:110
Ogre::SceneNode * m_raycastsnode
Definition OgreNewt_Debugger.h:113
void clearBodyDebugDataCache()
clear debug data cache for bodies (m_cachemap)
Definition OgreNewt_Debugger.cpp:96
void clearRaycastsRecorded()
clears all raycasts, that are currently shown, should probably be done once per frame!
Definition OgreNewt_Debugger.cpp:334
void processJoint(Joint *joint)
call the function to show debug information for this joint
Definition OgreNewt_Debugger.cpp:174
Ogre::ColourValue m_prefilterdiscardedcol
Definition OgreNewt_Debugger.h:115
void setMaterialColor(const MaterialID *mat, Ogre::ColourValue col)
set Material color
Definition OgreNewt_Debugger.cpp:154
ManualObjectList mRecordedRaycastObjects
Definition OgreNewt_Debugger.h:145
std::map< OgreNewt::Body *, BodyDebugData > BodyDebugDataMap
Definition OgreNewt_Debugger.h:132
void addDiscardedBody(const OgreNewt::Body *body)
this function is used internally
Definition OgreNewt_Debugger.cpp:446
void addConvexRay(const OgreNewt::ConvexCollisionPtr &col, const Ogre::Vector3 &startpt, const Ogre::Quaternion &colori, const Ogre::Vector3 &endpt)
this function is used internally
Definition OgreNewt_Debugger.cpp:388
Ogre::SceneManager * m_sceneManager
Definition OgreNewt_Debugger.h:106
void processBody(Body *body)
create debug information for one body
Definition OgreNewt_Debugger.cpp:202
void startRaycastRecording(bool markhitbodies=false)
enable additional raycast-debugging (this also enables displaying of recorded raycasts!...
Definition OgreNewt_Debugger.cpp:318
void addRay(const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt)
this function is used internally
Definition OgreNewt_Debugger.cpp:367
virtual void showDebugData(Ogre::SceneNode *debugRootNode)
show joint visual debugging data
Definition OgreNewt_Joint.h:57
void setCaption(const Ogre::String &caption)
Definition OgreNewt_Tools.cpp:342
void setLocalTranslation(Ogre::Vector3 trans)
Definition OgreNewt_Tools.cpp:397
void setTextAlignment(const HorizontalAlignment &horizontalAlignment, const VerticalAlignment &verticalAlignment)
Definition OgreNewt_Tools.cpp:378
NewtonWorld * getNewtonWorld() const
retrieves a pointer to the NewtonWorld
Definition OgreNewt_World.h:284
Body * getFirstBody() const
to iterate through all bodies call this function and then use body->getNext()
Definition OgreNewt_World.cpp:191
_OgreNewtExport void QuatPosToMatrix(const Ogre::Quaternion &quat, const Ogre::Vector3 &pos, dFloat *matrix)
Take a Quaternion and Position Matrix and create a Newton-happy float matrix!
Definition OgreNewt_Tools.cpp:33
Ogre::ManualObject * m_lines
Definition OgreNewt_Debugger.h:128
CollisionPtr m_lastcol
Definition OgreNewt_Debugger.h:125
OgreNewt::OgreAddons::MovableText * m_text
Definition OgreNewt_Debugger.h:129
Generated by 1.9.8