PyBullet: expose flags to createMultiBody
This commit is contained in:
@@ -1414,6 +1414,20 @@ B3_SHARED_API void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandH
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
B3_SHARED_API void b3CreateMultiBodySetFlags(b3SharedMemoryCommandHandle commandHandle, int flags)
|
||||
{
|
||||
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
|
||||
b3Assert(command);
|
||||
b3Assert(command->m_type == CMD_CREATE_MULTI_BODY);
|
||||
if (command->m_type==CMD_CREATE_MULTI_BODY)
|
||||
{
|
||||
command->m_updateFlags |= MULT_BODY_HAS_FLAGS;
|
||||
command->m_createMultiBodyArgs.m_flags = flags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
B3_SHARED_API int b3GetStatusMultiBodyUniqueId(b3SharedMemoryStatusHandle statusHandle)
|
||||
{
|
||||
const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle;
|
||||
|
||||
@@ -466,6 +466,8 @@ B3_SHARED_API int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandl
|
||||
|
||||
//useMaximalCoordinates are disabled by default, enabling them is experimental and not fully supported yet
|
||||
B3_SHARED_API void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3CreateMultiBodySetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
|
||||
//int b3CreateMultiBodyAddLink(b3SharedMemoryCommandHandle commandHandle, int jointType, int parentLinkIndex, double linkMass, int linkCollisionShapeUnique, int linkVisualShapeUniqueId);
|
||||
|
||||
|
||||
@@ -5804,6 +5804,12 @@ bool PhysicsServerCommandProcessor::processCreateMultiBodyCommand(const struct S
|
||||
}
|
||||
|
||||
int flags = 0;
|
||||
|
||||
if (clientCmd.m_updateFlags & MULT_BODY_HAS_FLAGS)
|
||||
{
|
||||
flags = clientCmd.m_createMultiBodyArgs.m_flags;
|
||||
}
|
||||
|
||||
bool ok = processImportedObjects("memory", bufferServerToClient, bufferSizeInBytes, useMultiBody, flags, u2b);
|
||||
|
||||
if (ok)
|
||||
|
||||
@@ -926,6 +926,7 @@ enum eCreateMultiBodyEnum
|
||||
{
|
||||
MULTI_BODY_HAS_BASE=1,
|
||||
MULT_BODY_USE_MAXIMAL_COORDINATES=2,
|
||||
MULT_BODY_HAS_FLAGS=4,
|
||||
};
|
||||
struct b3CreateMultiBodyArgs
|
||||
{
|
||||
@@ -947,7 +948,7 @@ struct b3CreateMultiBodyArgs
|
||||
int m_linkParentIndices[MAX_CREATE_MULTI_BODY_LINKS];
|
||||
int m_linkJointTypes[MAX_CREATE_MULTI_BODY_LINKS];
|
||||
double m_linkJointAxis[3*MAX_CREATE_MULTI_BODY_LINKS];
|
||||
|
||||
int m_flags;
|
||||
#if 0
|
||||
std::string m_name;
|
||||
std::string m_sourceFile;
|
||||
|
||||
Reference in New Issue
Block a user