2015-07-14 22:30:17 +00:00
|
|
|
#ifndef BT_PHYSICS_CLIENT_API_H
|
|
|
|
#define BT_PHYSICS_CLIENT_API_H
|
2015-05-28 23:05:24 +00:00
|
|
|
|
2015-09-17 06:09:10 +00:00
|
|
|
//#include "SharedMemoryCommands.h"
|
2015-08-20 05:51:16 +00:00
|
|
|
#include "LinearMath/btVector3.h"
|
2015-05-28 23:05:24 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
class PhysicsClient {
|
2015-07-14 22:30:17 +00:00
|
|
|
public:
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual ~PhysicsClient();
|
|
|
|
|
|
|
|
// return true if connection succesfull, can also check 'isConnected'
|
|
|
|
virtual bool connect() = 0;
|
|
|
|
|
|
|
|
virtual void disconnectSharedMemory() = 0;
|
|
|
|
|
|
|
|
virtual bool isConnected() const = 0;
|
|
|
|
|
|
|
|
// return non-null if there is a status, nullptr otherwise
|
|
|
|
virtual const struct SharedMemoryStatus* processServerStatus() = 0;
|
2015-07-14 22:30:17 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual struct SharedMemoryCommand* getAvailableSharedMemoryCommand() = 0;
|
2015-07-14 22:30:17 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual bool canSubmitCommand() const = 0;
|
2015-07-14 22:30:17 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual bool submitClientCommand(const struct SharedMemoryCommand& command) = 0;
|
2015-07-14 22:30:17 +00:00
|
|
|
|
2016-09-27 19:13:45 +00:00
|
|
|
virtual int getNumBodies() const = 0;
|
2015-07-14 22:30:17 +00:00
|
|
|
|
2016-09-27 19:13:45 +00:00
|
|
|
virtual int getBodyUniqueId(int serialIndex) const = 0;
|
|
|
|
|
|
|
|
virtual bool getBodyInfo(int bodyUniqueId, struct b3BodyInfo& info) const = 0;
|
|
|
|
|
|
|
|
virtual int getNumJoints(int bodyUniqueId) const = 0;
|
|
|
|
|
|
|
|
virtual bool getJointInfo(int bodyUniqueId, int jointIndex, struct b3JointInfo& info) const = 0;
|
2015-08-20 05:51:16 +00:00
|
|
|
|
2017-01-23 03:08:31 +00:00
|
|
|
virtual int getNumUserConstraints() const = 0;
|
|
|
|
|
|
|
|
virtual int getUserConstraintInfo(int constraintUniqueId, struct b3UserConstraint& info) const = 0;
|
2017-05-04 01:25:25 +00:00
|
|
|
|
|
|
|
virtual int getUserConstraintId(int serialIndex) const = 0;
|
2017-01-23 03:08:31 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual void setSharedMemoryKey(int key) = 0;
|
2015-08-20 05:51:16 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual void uploadBulletFileToSharedMemory(const char* data, int len) = 0;
|
2015-08-20 05:51:16 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual int getNumDebugLines() const = 0;
|
2015-08-20 05:51:16 +00:00
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
virtual const float* getDebugLinesFrom() const = 0;
|
|
|
|
virtual const float* getDebugLinesTo() const = 0;
|
|
|
|
virtual const float* getDebugLinesColor() const = 0;
|
2016-05-31 17:23:04 +00:00
|
|
|
|
|
|
|
virtual void getCachedCameraImage(struct b3CameraImageData* cameraData)=0;
|
|
|
|
|
2016-09-01 20:30:07 +00:00
|
|
|
virtual void getCachedContactPointInformation(struct b3ContactInformation* contactPointData)=0;
|
|
|
|
|
2016-11-10 19:22:22 +00:00
|
|
|
virtual void getCachedOverlappingObjects(struct b3AABBOverlapData* overlappingObjects) = 0;
|
|
|
|
|
2016-10-19 05:05:28 +00:00
|
|
|
virtual void getCachedVisualShapeInformation(struct b3VisualShapeInformation* visualShapesInfo) = 0;
|
|
|
|
|
2016-12-27 03:40:09 +00:00
|
|
|
virtual void getCachedVREvents(struct b3VREventsData* vrEventsData) = 0;
|
|
|
|
|
2017-03-02 20:33:22 +00:00
|
|
|
virtual void getCachedKeyboardEvents(struct b3KeyboardEventsData* keyboardEventsData) = 0;
|
|
|
|
|
2017-06-17 20:29:14 +00:00
|
|
|
virtual void getCachedMouseEvents(struct b3MouseEventsData* mouseEventsData) = 0;
|
|
|
|
|
2016-12-27 03:40:09 +00:00
|
|
|
virtual void getCachedRaycastHits(struct b3RaycastInformation* raycastHits) = 0;
|
|
|
|
|
2017-02-24 23:34:11 +00:00
|
|
|
virtual void setTimeOut(double timeOutInSeconds) = 0;
|
|
|
|
virtual double getTimeOut() const = 0;
|
|
|
|
|
2015-07-14 22:30:17 +00:00
|
|
|
};
|
|
|
|
|
2015-09-25 05:50:34 +00:00
|
|
|
#endif // BT_PHYSICS_CLIENT_API_H
|