diff options
author | Chuyuan Kelly Fu <fuchuyuan@google.com> | 2022-02-18 16:38:59 -0800 |
---|---|---|
committer | Chuyuan Kelly Fu <fuchuyuan@google.com> | 2022-02-18 17:49:26 -0800 |
commit | 4e5b3f34c90f1c5e31eb6fb30f4b0edae2203969 (patch) | |
tree | ee8df4d48fbaa39ece516809ea62e9e7a07ac5a5 | |
parent | 450c95d0b96032814ef3cd4f5c8b67a7fad3e1e4 (diff) | |
download | bullet3-4e5b3f34c90f1c5e31eb6fb30f4b0edae2203969.tar.gz |
add API to get and set mesh velocity
-rw-r--r-- | examples/SharedMemory/PhysicsClientC_API.cpp | 16 | ||||
-rw-r--r-- | examples/SharedMemory/PhysicsClientC_API.h | 4 |
2 files changed, 19 insertions, 1 deletions
diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 75f48e39d..ec697cdbf 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -1549,6 +1549,22 @@ B3_SHARED_API void b3GetMeshDataSetFlags(b3SharedMemoryCommandHandle commandHand } } +B3_SHARED_API void b3GetMeshDataSimulationMesh(b3SharedMemoryCommandHandle commandHandle) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle; + b3Assert(command); + b3Assert(command->m_type == CMD_REQUEST_MESH_DATA); + command->m_updateFlags |= B3_MESH_DATA_SIMULATION_MESH; +} + +B3_SHARED_API void b3MeshDataSimulationMeshVelocity(b3SharedMemoryCommandHandle commandHandle) +{ + struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle; + b3Assert(command); + b3Assert(command->m_type == CMD_REQUEST_MESH_DATA || command->m_type == CMD_RESET_MESH_DATA); + command->m_updateFlags |= B3_MESH_DATA_SIMULATION_MESH_VELOCITY; +} + B3_SHARED_API void b3GetMeshData(b3PhysicsClientHandle physClient, struct b3MeshData* meshData) { PhysicsClient* cl = (PhysicsClient*)physClient; diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h index c14feb82f..84dcda64c 100644 --- a/examples/SharedMemory/PhysicsClientC_API.h +++ b/examples/SharedMemory/PhysicsClientC_API.h @@ -532,7 +532,9 @@ extern "C" B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveCollisionShapeCommand(b3PhysicsClientHandle physClient, int collisionShapeId); B3_SHARED_API b3SharedMemoryCommandHandle b3GetMeshDataCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex); - B3_SHARED_API void b3GetMeshDataSetCollisionShapeIndex(b3SharedMemoryCommandHandle commandHandle, int shapeIndex); + B3_SHARED_API void b3GetMeshDataSimulationMesh(b3SharedMemoryCommandHandle commandHandle); + B3_SHARED_API void b3MeshDataSimulationMeshVelocity(b3SharedMemoryCommandHandle commandHandle); + B3_SHARED_API void b3GetMeshDataSetCollisionShapeIndex(b3SharedMemoryCommandHandle commandHandle, int shapeIndex); B3_SHARED_API void b3GetMeshDataSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags); B3_SHARED_API void b3GetMeshData(b3PhysicsClientHandle physClient, struct b3MeshData* meshData); |