add API for setting repulsion stiffness

This commit is contained in:
Xuchen Han
2020-04-27 17:42:45 -07:00
parent 301cad8a09
commit ae3526254d
6 changed files with 42 additions and 13 deletions

View File

@@ -404,6 +404,15 @@ B3_SHARED_API int b3LoadSoftBodySetCollisionHardness(b3SharedMemoryCommandHandle
return 0;
}
B3_SHARED_API int b3LoadSoftBodySetRepulsionStiffness(b3SharedMemoryCommandHandle commandHandle, double stiffness)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
b3Assert(command->m_type == CMD_LOAD_SOFT_BODY);
command->m_loadSoftBodyArguments.m_repulsionStiffness = stiffness;
command->m_updateFlags |= LOAD_SOFT_BODY_SET_REPULSION_STIFFNESS;
return 0;
}
B3_SHARED_API int b3LoadSoftBodySetSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;