make PhysicsClient an interface class, and move shared memory implementation
of physics client into PhysicsClientSharedMemory class/file. This will allow implementation of UDP and other transport protocols to a physics server.
This commit is contained in:
@@ -4,46 +4,39 @@
|
||||
//#include "SharedMemoryCommands.h"
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
class PhysicsClientSharedMemory
|
||||
{
|
||||
struct PhysicsClientSharedMemoryInternalData* m_data;
|
||||
protected:
|
||||
|
||||
class PhysicsClient {
|
||||
public:
|
||||
virtual ~PhysicsClient();
|
||||
|
||||
PhysicsClientSharedMemory();
|
||||
virtual ~PhysicsClientSharedMemory();
|
||||
// return true if connection succesfull, can also check 'isConnected'
|
||||
virtual bool connect() = 0;
|
||||
|
||||
//return true if connection succesfull, can also check 'isConnected'
|
||||
virtual bool connect();
|
||||
|
||||
virtual void disconnectSharedMemory ();
|
||||
virtual void disconnectSharedMemory() = 0;
|
||||
|
||||
virtual bool isConnected() const;
|
||||
virtual bool isConnected() const = 0;
|
||||
|
||||
// return non-null if there is a status, nullptr otherwise
|
||||
virtual const struct SharedMemoryStatus* processServerStatus();
|
||||
|
||||
virtual struct SharedMemoryCommand* getAvailableSharedMemoryCommand();
|
||||
|
||||
virtual bool canSubmitCommand() const;
|
||||
|
||||
virtual bool submitClientCommand(const struct SharedMemoryCommand& command);
|
||||
// return non-null if there is a status, nullptr otherwise
|
||||
virtual const struct SharedMemoryStatus* processServerStatus() = 0;
|
||||
|
||||
virtual int getNumJoints() const;
|
||||
|
||||
virtual void getJointInfo(int index, struct b3JointInfo& info) const;
|
||||
|
||||
virtual void setSharedMemoryKey(int key);
|
||||
virtual struct SharedMemoryCommand* getAvailableSharedMemoryCommand() = 0;
|
||||
|
||||
virtual void uploadBulletFileToSharedMemory(const char* data, int len);
|
||||
virtual bool canSubmitCommand() const = 0;
|
||||
|
||||
virtual int getNumDebugLines() const;
|
||||
virtual bool submitClientCommand(const struct SharedMemoryCommand& command) = 0;
|
||||
|
||||
virtual const float* getDebugLinesFrom() const;
|
||||
virtual const float* getDebugLinesTo() const;
|
||||
virtual const float* getDebugLinesColor() const;
|
||||
virtual int getNumJoints() const = 0;
|
||||
|
||||
virtual void getJointInfo(int index, struct b3JointInfo& info) const = 0;
|
||||
|
||||
virtual void setSharedMemoryKey(int key) = 0;
|
||||
|
||||
virtual void uploadBulletFileToSharedMemory(const char* data, int len) = 0;
|
||||
|
||||
virtual int getNumDebugLines() const = 0;
|
||||
|
||||
virtual const float* getDebugLinesFrom() const = 0;
|
||||
virtual const float* getDebugLinesTo() const = 0;
|
||||
virtual const float* getDebugLinesColor() const = 0;
|
||||
};
|
||||
|
||||
#endif //BT_PHYSICS_CLIENT_API_H
|
||||
#endif // BT_PHYSICS_CLIENT_API_H
|
||||
|
||||
Reference in New Issue
Block a user