revert API to be backward compatible, add b3CreateInProcessPhysicsServerAndConnectSharedMemory
same for BulletURDFImporter constructor
This commit is contained in:
@@ -15,7 +15,7 @@ class BulletURDFImporter : public URDFImporterInterface
|
||||
|
||||
public:
|
||||
|
||||
BulletURDFImporter(struct GUIHelperInterface* helper, LinkVisualShapesConverter* customConverter, btScalar globalScaling);
|
||||
BulletURDFImporter(struct GUIHelperInterface* helper, LinkVisualShapesConverter* customConverter, btScalar globalScaling=1);
|
||||
|
||||
virtual ~BulletURDFImporter();
|
||||
|
||||
|
||||
@@ -129,9 +129,9 @@ bool b3RobotSimulatorClientAPI::connect(int mode, const std::string& hostName, i
|
||||
int argc = 0;
|
||||
char* argv[1] = {0};
|
||||
#ifdef __APPLE__
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv,1);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv);
|
||||
#else
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv,1);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -140,9 +140,9 @@ bool b3RobotSimulatorClientAPI::connect(int mode, const std::string& hostName, i
|
||||
int argc = 0;
|
||||
char* argv[1] = {0};
|
||||
#ifdef __APPLE__
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv,0);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv);
|
||||
#else
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv,0);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -83,14 +83,24 @@ public:
|
||||
|
||||
};
|
||||
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[], int useInProcessMemory)
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[])
|
||||
{
|
||||
InProcessPhysicsClientSharedMemoryMainThread* cl = new InProcessPhysicsClientSharedMemoryMainThread(argc, argv, useInProcessMemory);
|
||||
InProcessPhysicsClientSharedMemoryMainThread* cl = new InProcessPhysicsClientSharedMemoryMainThread(argc, argv, 1);
|
||||
cl->setSharedMemoryKey(SHARED_MEMORY_KEY);
|
||||
cl->connect();
|
||||
return (b3PhysicsClientHandle ) cl;
|
||||
}
|
||||
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, char* argv[])
|
||||
{
|
||||
InProcessPhysicsClientSharedMemoryMainThread* cl = new InProcessPhysicsClientSharedMemoryMainThread(argc, argv, 0);
|
||||
cl->setSharedMemoryKey(SHARED_MEMORY_KEY);
|
||||
cl->connect();
|
||||
return (b3PhysicsClientHandle ) cl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class InProcessPhysicsClientSharedMemory : public PhysicsClientSharedMemory
|
||||
{
|
||||
btInProcessExampleBrowserInternalData* m_data;
|
||||
@@ -123,10 +133,18 @@ public:
|
||||
|
||||
};
|
||||
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[], int useInProcessMemory)
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[])
|
||||
{
|
||||
|
||||
InProcessPhysicsClientSharedMemory* cl = new InProcessPhysicsClientSharedMemory(argc, argv, useInProcessMemory);
|
||||
InProcessPhysicsClientSharedMemory* cl = new InProcessPhysicsClientSharedMemory(argc, argv, 1);
|
||||
cl->setSharedMemoryKey(SHARED_MEMORY_KEY+1);
|
||||
cl->connect();
|
||||
return (b3PhysicsClientHandle ) cl;
|
||||
}
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, char* argv[])
|
||||
{
|
||||
|
||||
InProcessPhysicsClientSharedMemory* cl = new InProcessPhysicsClientSharedMemory(argc, argv, 0);
|
||||
cl->setSharedMemoryKey(SHARED_MEMORY_KEY+1);
|
||||
cl->connect();
|
||||
return (b3PhysicsClientHandle ) cl;
|
||||
|
||||
@@ -10,9 +10,11 @@ extern "C" {
|
||||
|
||||
|
||||
///think more about naming. The b3ConnectPhysicsLoopback
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[], int useInProcessMemory);
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnect(int argc, char* argv[]);
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectSharedMemory(int argc, char* argv[]);
|
||||
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[], int useInProcessMemory);
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThread(int argc, char* argv[]);
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(int argc, char* argv[]);
|
||||
|
||||
b3PhysicsClientHandle b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect(void* guiHelperPtr);
|
||||
|
||||
|
||||
@@ -355,9 +355,9 @@ static PyObject* pybullet_connectPhysicsServer(PyObject* self, PyObject* args, P
|
||||
char* argv[2] = {"unused",options};
|
||||
|
||||
#ifdef __APPLE__
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv,1);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv);
|
||||
#else
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv,1);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -367,9 +367,9 @@ static PyObject* pybullet_connectPhysicsServer(PyObject* self, PyObject* args, P
|
||||
char* argv[2] = {"unused",options};
|
||||
|
||||
#ifdef __APPLE__
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThread(argc, argv,0);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectMainThreadSharedMemory(argc, argv);
|
||||
#else
|
||||
sm = b3CreateInProcessPhysicsServerAndConnect(argc, argv,0);
|
||||
sm = b3CreateInProcessPhysicsServerAndConnectSharedMemory(argc, argv);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user