My Project
ParaPhysics.h
1 #pragma once
2 #include "IParaPhysics.h"
3 
4 namespace ParaEngine
5 {
7  {
8  public:
10 
11  public:
12  virtual bool InitPhysics();
13 
14  virtual bool StepSimulation(float fDeltaTime);
15 
16  virtual bool ExitPhysics();
17 
18  virtual void Release();
19 
21 
22  virtual void ReleaseShape(IParaPhysicsShape *pShape);
23 
24  virtual IParaPhysicsActor* CreateActor(const ParaPhysicsActorDesc& meshDesc);
25 
26  virtual void ReleaseActor(IParaPhysicsActor* pActor);
27 
28  virtual IParaPhysicsActor* RaycastClosestShape(const PARAVECTOR3& vOrigin, const PARAVECTOR3& vDirection, DWORD dwType, RayCastHitResult& hit, short dwGroupMask, float fSensorRange);
29 
30  virtual void SetDebugDrawer(IParaDebugDraw* debugDrawer);
31 
32  virtual IParaDebugDraw* GetDebugDrawer();
33 
34  virtual void DebugDrawObject(const PARAVECTOR3& vOrigin, const PARAMATRIX3x3& vRotation, const IParaPhysicsShape* pShape, const PARAVECTOR3& color);
35 
36  virtual void DebugDrawWorld();
37 
38  virtual void SetDebugDrawMode(int debugMode);
39 
40  virtual int GetDebugDrawMode();
41  protected:
42  IParaDebugDraw* m_pDebugDrawer;
43  int m_nDebugMode;
44  };
45 }
46 
47 
virtual bool InitPhysics()
create and initialize all physics lib and create the default scene(world)
Definition: ParaPhysics.cpp:21
virtual IParaPhysicsActor * CreateActor(const ParaPhysicsActorDesc &meshDesc)
create an physics actor(rigid body) in the current world.
Definition: ParaPhysics.cpp:51
Definition: PEtypes.h:327
virtual void Release()
all this to unload the IPhysics.
Definition: ParaPhysics.cpp:36
different physics engine has different winding order.
Definition: EventBinding.h:32
virtual void SetDebugDrawer(IParaDebugDraw *debugDrawer)
set the debug draw object for debugging physics world.
Definition: ParaPhysics.cpp:66
Definition: ParaPhysics.h:6
virtual bool ExitPhysics()
cleanup all physics entities.
Definition: ParaPhysics.cpp:31
virtual IParaPhysicsActor * RaycastClosestShape(const PARAVECTOR3 &vOrigin, const PARAVECTOR3 &vDirection, DWORD dwType, RayCastHitResult &hit, short dwGroupMask, float fSensorRange)
ray cast a given group.
Definition: ParaPhysics.cpp:61
virtual IParaPhysicsShape * CreateTriangleMeshShap(const ParaPhysicsTriangleMeshDesc &meshDesc)
create a triangle shape.
Definition: ParaPhysics.cpp:41
Create descriptor for triangle mesh shape.
Definition: IParaPhysics.h:30
it is represent a shape that can be used to create various actors in the scene.
Definition: IParaPhysics.h:42
IParaDebugDraw draw interface draws line based primitives for debugging purposes. ...
Definition: IParaDebugDraw.h:10
virtual void SetDebugDrawMode(int debugMode)
bitwise of PhysicsDebugDrawModes
Definition: ParaPhysics.cpp:84
Definition: IParaPhysics.h:91
virtual void DebugDrawObject(const PARAVECTOR3 &vOrigin, const PARAMATRIX3x3 &vRotation, const IParaPhysicsShape *pShape, const PARAVECTOR3 &color)
draw a given object.
Definition: ParaPhysics.cpp:76
ParaPhysics core interface.
Definition: IParaPhysics.h:100
virtual bool StepSimulation(float fDeltaTime)
step simulation
Definition: ParaPhysics.cpp:26
it is represent a shape that can be used to create various actors in the scene.
Definition: IParaPhysics.h:79
virtual int GetDebugDrawMode()
bitwise of PhysicsDebugDrawModes
Definition: ParaPhysics.cpp:89
Definition: PEtypes.h:298
virtual void DebugDrawWorld()
draw the entire physics debug world.
Definition: ParaPhysics.cpp:80
virtual void ReleaseActor(IParaPhysicsActor *pActor)
release a physics actor
Definition: ParaPhysics.cpp:56
Create descriptor for a physics actor.
Definition: IParaPhysics.h:56
virtual void ReleaseShape(IParaPhysicsShape *pShape)
release a physics shape
Definition: ParaPhysics.cpp:46
virtual IParaDebugDraw * GetDebugDrawer()
Get the debug draw object for debugging physics world.
Definition: ParaPhysics.cpp:71