physxDebugHelper.h

00001 
00002 // protect multiple inclusion
00003 #ifndef _PHYSXDEBUGHELPER_H_INCLUDED_
00004 #define _PHYSXDEBUGHELPER_H_INCLUDED_
00005 
00006 
00007 #include "NXU_helper.h"
00008 
00009 
00010 
00011 // used by irrlichtWrapper update()
00012 // set by controler onKeyEvent()
00013 void switchPhysxDebugRenderingEnabled();
00014 bool getPhysxDebugRenderingEnabled();
00015 
00016 
00017 
00018 // an object of this class is given to NxCreatePhysicsSDK() to output physX errors
00019 class NxDebugOutput : public NxUserOutputStream
00020 {
00021 public:
00022     virtual void reportError(NxErrorCode code, const char* message, const char* file, int line);
00023     virtual NxAssertResponse reportAssertViolation(const char* message, const char* file, int line);    
00024     virtual void print(const char* message);
00025 };
00026 
00027 
00028 // an object of this class uses irrlicht to render debug data (triangles), given from physX debug visualization
00029 class NxDebugRenderer
00030 {
00031 public:
00032         NxDebugRenderer();
00033         ~NxDebugRenderer();
00034 
00035         // must be called from irrlicht update()
00036         // i.e. "within beginScene() and endScene()"
00037         // because irrlicht must be in proper render state to draw below lines
00038         ERR_TYPE update( f32 timeMS );
00039 };
00040 
00041 
00042 // an object of this class is set in the NXU_helper (the XML data driven PhysX loader), to output physX errors
00043 class NxuDebugOutput : public NXU_errorReport
00044 {
00045 public:
00046     virtual     void NXU_errorMessage(bool isError, const char* str);
00047 };
00048 
00049 
00050 // an object of this class is set in the NXU_helper (the XML data driven PhysX loader), to output physX create notifications
00051 class NxuUserNotify : public NXU_userNotify
00052 {
00053 public:
00054 
00055         // Notifies the application that a new scene has been created.
00056         virtual void    NXU_notifyScene(NxU32 sno, NxScene* scene, const char* userProperties);
00057 
00058         // Notifies the application that a new actor has been created.
00059         virtual void    NXU_notifyActor(NxActor* actor, const char* userProperties);
00060 
00061         // Notifies the application that a new TriangleMesh that has been created.
00062         virtual void    NXU_notifyTriangleMesh(NxTriangleMesh *t, const char* userProperties);
00063 
00064         // Pre-notification event before a new scene is about to be created.
00065         // return a NULL pointer to have the instantiator create the scene.  A non-null pointer is the NxScene the application wants the data to be loaded into.
00066         virtual NxScene *NXU_preNotifyScene(unsigned int sno, NxSceneDesc& scene, const char* userProperties);
00067 
00068         // Pre-notification event before an actor is created.
00069         // return true to create the actor or false to skip it.
00070         virtual bool    NXU_preNotifyActor(NxActorDesc& actor, const char* userProperties);
00071 
00072         // Pre-notification event before a triangle mesh is created.
00073         // return true to create the triangle mesh or false to skip it.
00074         virtual bool    NXU_preNotifyTriangleMesh(NxTriangleMeshDesc& t, const char* userProperties);
00075 
00076         // Pre-notification event before a SceneInstance is executed.
00077         // return true to execute the scene instance.
00078         virtual bool    NXU_preNotifySceneInstance(const char* name, const char* sceneName, const char* userProperties, NxMat34& rootNode, NxU32 depth);
00079 
00080         // Notification event because a scene failed to be created.
00081         virtual void    NXU_notifySceneFailed(unsigned int sno, NxSceneDesc& scene, const char* userProperties);
00082 
00083         // Notification event that an actor failed to be created.
00084         virtual void    NXU_notifyActorFailed(NxActorDesc& actor, const char* userProperties);
00085 
00086         // Notification event that a triangle mesh failed to be created.
00087         virtual void    NXU_notifyTriangleMeshFailed(NxTriangleMeshDesc& t,const char* userProperties);
00088 };
00089 
00090 
00091 #endif // #ifndef _PHYSXDEBUGHELPER_H_INCLUDED_

Generated on Sun Dec 2 03:10:23 2007 for TableTop by  doxygen 1.5.4