2015-11-23 04:50:32 +00:00
|
|
|
#ifndef PHYSICS_SERVER_SHARED_MEMORY_H
|
|
|
|
#define PHYSICS_SERVER_SHARED_MEMORY_H
|
|
|
|
|
|
|
|
#include "PhysicsServer.h"
|
2017-05-31 02:54:55 +00:00
|
|
|
#include "LinearMath/btQuaternion.h"
|
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
class PhysicsServerSharedMemory : public PhysicsServer
|
|
|
|
{
|
|
|
|
struct PhysicsServerSharedMemoryInternalData* m_data;
|
|
|
|
|
|
|
|
protected:
|
2018-09-23 21:17:31 +00:00
|
|
|
void releaseSharedMemory();
|
2015-11-23 04:50:32 +00:00
|
|
|
|
|
|
|
public:
|
2017-05-31 02:54:55 +00:00
|
|
|
PhysicsServerSharedMemory(struct CommandProcessorCreationInterface* commandProcessorCreator, class SharedMemoryInterface* sharedMem, int bla);
|
2015-11-23 04:50:32 +00:00
|
|
|
virtual ~PhysicsServerSharedMemory();
|
|
|
|
|
|
|
|
virtual void setSharedMemoryKey(int key);
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
//todo: implement option to allocated shared memory from client
|
|
|
|
virtual bool connectSharedMemory(struct GUIHelperInterface* guiHelper);
|
|
|
|
|
|
|
|
virtual void disconnectSharedMemory(bool deInitializeSharedMemory);
|
2015-11-23 04:50:32 +00:00
|
|
|
|
|
|
|
virtual void processClientCommands();
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
virtual void stepSimulationRealTime(double dtInSec, const struct b3VRControllerEvent* vrEvents, int numVREvents, const struct b3KeyboardEvent* keyEvents, int numKeyEvents, const struct b3MouseEvent* mouseEvents, int numMouseEvents);
|
2016-07-18 06:50:11 +00:00
|
|
|
|
2016-12-11 17:28:36 +00:00
|
|
|
virtual void enableRealTimeSimulation(bool enableRealTimeSim);
|
2017-05-31 02:54:55 +00:00
|
|
|
virtual bool isRealTimeSimulationEnabled() const;
|
2016-12-11 17:28:36 +00:00
|
|
|
|
2018-07-25 12:47:34 +00:00
|
|
|
virtual void reportNotifications();
|
2018-07-24 12:12:16 +00:00
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
//bool supportsJointMotor(class btMultiBody* body, int linkIndex);
|
|
|
|
|
|
|
|
///The pickBody method will try to pick the first body along a ray, return true if succeeds, false otherwise
|
|
|
|
virtual bool pickBody(const btVector3& rayFromWorld, const btVector3& rayToWorld);
|
|
|
|
virtual bool movePickedBody(const btVector3& rayFromWorld, const btVector3& rayToWorld);
|
|
|
|
virtual void removePickingConstraint();
|
|
|
|
|
2017-05-31 02:54:55 +00:00
|
|
|
virtual const btVector3& getVRTeleportPosition() const;
|
2017-06-01 23:48:07 +00:00
|
|
|
virtual void setVRTeleportPosition(const btVector3& vrTeleportPos);
|
2017-05-31 02:54:55 +00:00
|
|
|
|
|
|
|
virtual const btQuaternion& getVRTeleportOrientation() const;
|
2017-06-01 23:48:07 +00:00
|
|
|
virtual void setVRTeleportOrientation(const btQuaternion& vrTeleportOrn);
|
2017-05-31 02:54:55 +00:00
|
|
|
|
2015-11-23 04:50:32 +00:00
|
|
|
//for physicsDebugDraw and renderScene are mainly for debugging purposes
|
|
|
|
//and for physics visualization. The idea is that physicsDebugDraw can also send wireframe
|
|
|
|
//to a physics client, over shared memory
|
2018-09-23 21:17:31 +00:00
|
|
|
void physicsDebugDraw(int debugDrawFlags);
|
|
|
|
void renderScene(int renderFlags);
|
|
|
|
void syncPhysicsToGraphics();
|
2015-11-23 04:50:32 +00:00
|
|
|
|
|
|
|
void enableCommandLogging(bool enable, const char* fileName);
|
|
|
|
void replayFromLogFile(const char* fileName);
|
|
|
|
};
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
#endif //PHYSICS_SERVER_EXAMPLESHARED_MEMORY_H
|