load render mesh from command

This commit is contained in:
Xuchen Han
2019-11-17 00:01:52 -08:00
parent f5400b40d2
commit 6c34c91ca7
4 changed files with 50 additions and 27 deletions

View File

@@ -338,6 +338,24 @@ B3_SHARED_API int b3LoadSoftBodySetStartOrientation(b3SharedMemoryCommandHandle
return 0;
}
B3_SHARED_API int b3LoadSoftBodyAddRenderMesh(b3SharedMemoryCommandHandle commandHandle, const char* filename)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
b3Assert(command->m_type == CMD_LOAD_SOFT_BODY);
int len = strlen(filename);
if (len < MAX_FILENAME_LENGTH)
{
strcpy(command->m_loadSoftBodyArguments.m_renderFileName, filename);
}
else
{
command->m_loadSoftBodyArguments.m_renderFileName[0] = 0;
}
command->m_updateFlags |= LOAD_SOFT_BODY_RENDER_MESH;
return 0;
}
B3_SHARED_API int b3LoadSoftBodyAddCorotatedForce(b3SharedMemoryCommandHandle commandHandle, double corotatedMu, double corotatedLambda)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;