PhysicsServerSharedMemory.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef PHYSICS_SERVER_SHARED_MEMORY_H
  2. #define PHYSICS_SERVER_SHARED_MEMORY_H
  3. #include "PhysicsServer.h"
  4. class PhysicsServerSharedMemory : public PhysicsServer
  5. {
  6. struct PhysicsServerSharedMemoryInternalData* m_data;
  7. protected:
  8. void releaseSharedMemory();
  9. public:
  10. PhysicsServerSharedMemory(class SharedMemoryInterface* sharedMem=0);
  11. virtual ~PhysicsServerSharedMemory();
  12. virtual void setSharedMemoryKey(int key);
  13. //todo: implement option to allocated shared memory from client
  14. virtual bool connectSharedMemory( struct GUIHelperInterface* guiHelper);
  15. virtual void disconnectSharedMemory (bool deInitializeSharedMemory);
  16. virtual void processClientCommands();
  17. virtual void stepSimulationRealTime(double dtInSec);
  18. //bool supportsJointMotor(class btMultiBody* body, int linkIndex);
  19. //@todo(erwincoumans) Should we have shared memory commands for picking objects?
  20. ///The pickBody method will try to pick the first body along a ray, return true if succeeds, false otherwise
  21. virtual bool pickBody(const btVector3& rayFromWorld, const btVector3& rayToWorld);
  22. virtual bool movePickedBody(const btVector3& rayFromWorld, const btVector3& rayToWorld);
  23. virtual void removePickingConstraint();
  24. //for physicsDebugDraw and renderScene are mainly for debugging purposes
  25. //and for physics visualization. The idea is that physicsDebugDraw can also send wireframe
  26. //to a physics client, over shared memory
  27. void physicsDebugDraw(int debugDrawFlags);
  28. void renderScene();
  29. void enableCommandLogging(bool enable, const char* fileName);
  30. void replayFromLogFile(const char* fileName);
  31. void resetDynamicsWorld();
  32. };
  33. #endif //PHYSICS_SERVER_EXAMPLESHARED_MEMORY_H