summaryrefslogtreecommitdiff
path: root/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h')
-rw-r--r--examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h b/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h
index 297c7e203..d8fd179c0 100644
--- a/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h
+++ b/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h
@@ -52,6 +52,43 @@ struct b3RobotSimulatorLoadSdfFileArgs
}
};
+struct b3RobotSimulatorLoadSoftBodyArgs
+{
+ btVector3 m_startPosition;
+ btQuaternion m_startOrientation;
+ double m_scale;
+ double m_mass;
+ double m_collisionMargin;
+
+ b3RobotSimulatorLoadSoftBodyArgs(const btVector3 &startPos, const btQuaternion &startOrn, const double &scale, const double &mass, const double &collisionMargin)
+ : m_startPosition(startPos),
+ m_startOrientation(startOrn),
+ m_scale(scale),
+ m_mass(mass),
+ m_collisionMargin(collisionMargin)
+ {
+ }
+
+ b3RobotSimulatorLoadSoftBodyArgs(const btVector3 &startPos, const btQuaternion &startOrn)
+ {
+ b3RobotSimulatorLoadSoftBodyArgs(startPos, startOrn, 1.0, 1.0, 0.02);
+ }
+
+ b3RobotSimulatorLoadSoftBodyArgs()
+ {
+ b3RobotSimulatorLoadSoftBodyArgs(btVector3(0, 0, 0), btQuaternion(0, 0, 0, 1));
+ }
+
+ b3RobotSimulatorLoadSoftBodyArgs(double scale, double mass, double collisionMargin)
+ : m_startPosition(btVector3(0, 0, 0)),
+ m_startOrientation(btQuaternion(0, 0, 0, 1)),
+ m_scale(scale),
+ m_mass(mass),
+ m_collisionMargin(collisionMargin)
+ {
+ }
+};
+
struct b3RobotSimulatorLoadFileResults
{
btAlignedObjectArray<int> m_uniqueObjectIds;
@@ -647,7 +684,7 @@ public:
int getConstraintUniqueId(int serialIndex);
- void loadSoftBody(const std::string &fileName, double scale, double mass, double collisionMargin);
+ void loadSoftBody(const std::string &fileName, const struct b3RobotSimulatorLoadSoftBodyArgs &args);
virtual void setGuiHelper(struct GUIHelperInterface *guiHelper);
virtual struct GUIHelperInterface *getGuiHelper();