PhysicsServerCommandProcessor.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef PHYSICS_SERVER_COMMAND_PROCESSOR_H
  2. #define PHYSICS_SERVER_COMMAND_PROCESSOR_H
  3. #include "LinearMath/btVector3.h"
  4. struct SharedMemLines
  5. {
  6. btVector3 m_from;
  7. btVector3 m_to;
  8. btVector3 m_color;
  9. };
  10. ///todo: naming. Perhaps PhysicsSdkCommandprocessor?
  11. class PhysicsServerCommandProcessor
  12. {
  13. struct PhysicsServerCommandProcessorInternalData* m_data;
  14. protected:
  15. bool loadUrdf(const char* fileName, const class btVector3& pos, const class btQuaternion& orn,
  16. bool useMultiBody, bool useFixedBase, int* bodyUniqueIdPtr, char* bufferServerToClient, int bufferSizeInBytes);
  17. bool supportsJointMotor(class btMultiBody* body, int linkIndex);
  18. public:
  19. PhysicsServerCommandProcessor();
  20. virtual ~PhysicsServerCommandProcessor();
  21. void createJointMotors(class btMultiBody* body);
  22. virtual void createEmptyDynamicsWorld();
  23. virtual void deleteDynamicsWorld();
  24. virtual bool processCommand(const struct SharedMemoryCommand& clientCmd, struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes );
  25. virtual void renderScene();
  26. virtual void physicsDebugDraw(int debugDrawFlags);
  27. virtual void setGuiHelper(struct GUIHelperInterface* guiHelper);
  28. //@todo(erwincoumans) Should we have shared memory commands for picking objects?
  29. ///The pickBody method will try to pick the first body along a ray, return true if succeeds, false otherwise
  30. virtual bool pickBody(const btVector3& rayFromWorld, const btVector3& rayToWorld);
  31. virtual bool movePickedBody(const btVector3& rayFromWorld, const btVector3& rayToWorld);
  32. virtual void removePickingConstraint();
  33. void enableCommandLogging(bool enable, const char* fileName);
  34. void replayFromLogFile(const char* fileName);
  35. };
  36. #endif //PHYSICS_SERVER_COMMAND_PROCESSOR_H