support configuring gravity factor from client

This commit is contained in:
Xuchen Han
2020-05-26 16:49:52 -07:00
parent e89903a8ab
commit 8a189763df
5 changed files with 30 additions and 3 deletions

View File

@@ -413,6 +413,15 @@ B3_SHARED_API int b3LoadSoftBodySetRepulsionStiffness(b3SharedMemoryCommandHandl
return 0;
}
B3_SHARED_API int b3LoadSoftBodySetGravityFactor(b3SharedMemoryCommandHandle commandHandle, double gravFactor)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
b3Assert(command->m_type == CMD_LOAD_SOFT_BODY);
command->m_loadSoftBodyArguments.m_gravFactor = gravFactor;
command->m_updateFlags |= LOAD_SOFT_BODY_SET_GRAVITY_FACTOR;
return 0;
}
B3_SHARED_API int b3LoadSoftBodySetSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;