mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 13:50:04 +00:00
Parse physicsClientId before calling getPhysicsClient
This commit is contained in:
parent
c993175a58
commit
b4eca192fb
@ -6293,17 +6293,17 @@ static PyObject* pybullet_setCollisionFilterGroupMask(PyObject* self, PyObject*
|
||||
|
||||
static char* kwlist[] = {"bodyUniqueId", "linkIndexA", "collisionFilterGroup", "collisionFilterMask", "physicsClientId", NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiii|i", kwlist,
|
||||
&bodyUniqueIdA, &linkIndexA, &collisionFilterGroup, &collisionFilterMask, &physicsClientId))
|
||||
return NULL;
|
||||
|
||||
sm = getPhysicsClient(physicsClientId);
|
||||
if (sm == 0)
|
||||
{
|
||||
PyErr_SetString(SpamError, "Not connected to physics server.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiii|i", kwlist,
|
||||
&bodyUniqueIdA, &linkIndexA, &collisionFilterGroup, &collisionFilterMask, &physicsClientId))
|
||||
return NULL;
|
||||
|
||||
|
||||
commandHandle = b3CollisionFilterCommandInit(sm);
|
||||
b3SetCollisionFilterGroupMask(commandHandle, bodyUniqueIdA, linkIndexA, collisionFilterGroup, collisionFilterMask);
|
||||
|
||||
@ -6329,6 +6329,10 @@ static PyObject* pybullet_setCollisionFilterPair(PyObject* self, PyObject* args,
|
||||
|
||||
static char* kwlist[] = {"bodyUniqueIdA", "bodyUniqueIdB", "linkIndexA", "linkIndexB", "enableCollision", "physicsClientId", NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiiii|i", kwlist,
|
||||
&bodyUniqueIdA, &bodyUniqueIdB, &linkIndexA, &linkIndexB, &enableCollision, &physicsClientId))
|
||||
return NULL;
|
||||
|
||||
sm = getPhysicsClient(physicsClientId);
|
||||
if (sm == 0)
|
||||
{
|
||||
@ -6336,10 +6340,6 @@ static PyObject* pybullet_setCollisionFilterPair(PyObject* self, PyObject* args,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiiii|i", kwlist,
|
||||
&bodyUniqueIdA, &bodyUniqueIdB, &linkIndexA, &linkIndexB, &enableCollision, &physicsClientId))
|
||||
return NULL;
|
||||
|
||||
commandHandle = b3CollisionFilterCommandInit(sm);
|
||||
b3SetCollisionFilterPair(commandHandle, bodyUniqueIdA, bodyUniqueIdB, linkIndexA, linkIndexB, enableCollision);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user