Expose CFM parameters in PhysicsClient.

Add b3PhysicsParamSetDefaultGlobalCFM() and
b3PhysicsParamSetDefaultFrictionCFM().
This commit is contained in:
Yuchen Wu
2018-05-16 13:46:19 -07:00
parent 653f592ddc
commit f03ae5a857
5 changed files with 35 additions and 2 deletions

View File

@@ -649,6 +649,24 @@ B3_SHARED_API int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandl
return 0;
}
B3_SHARED_API int b3PhysicsParamSetDefaultGlobalCFM(b3SharedMemoryCommandHandle commandHandle, double defaultGlobalCFM)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS);
command->m_updateFlags |= SIM_PARAM_UPDATE_DEFAULT_GLOBAL_CFM;
command->m_physSimParamArgs.m_defaultGlobalCFM = defaultGlobalCFM;
return 0;
}
B3_SHARED_API int b3PhysicsParamSetDefaultFrictionCFM(b3SharedMemoryCommandHandle commandHandle, double frictionCFM)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command->m_type == CMD_SEND_PHYSICS_SIMULATION_PARAMETERS);
command->m_updateFlags |= SIM_PARAM_UPDATE_DEFAULT_FRICTION_CFM;
command->m_physSimParamArgs.m_frictionCFM = frictionCFM;
return 0;
}
B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient)
{