diff options
author | root <root@DESKTOP-MH9K9U5.localdomain> | 2020-07-18 07:41:14 -0700 |
---|---|---|
committer | root <root@DESKTOP-MH9K9U5.localdomain> | 2020-07-18 07:41:14 -0700 |
commit | 1685aae597e152431aa626a1af7ea15075981a1c (patch) | |
tree | 806fd372910acb6f3168f9be65ee3212f6ee5977 | |
parent | 6af885aa12dfd1dce0fc7353743b23bafdc7f210 (diff) | |
parent | b67bf28f9360b988a02727bb558a09c6dcc9e27a (diff) | |
download | bullet3-1685aae597e152431aa626a1af7ea15075981a1c.tar.gz |
Merge branch 'master' of github.com:bulletphysics/bullet3
3 files changed, 28 insertions, 0 deletions
diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 5760c1e5b..cc3fb5c9d 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -2038,6 +2038,12 @@ PhysicsServerCommandProcessor::~PhysicsServerCommandProcessor() if (m_data->m_threadPool) delete m_data->m_threadPool; + for (int i = 0; i < m_data->m_savedStates.size(); i++) + { + delete m_data->m_savedStates[i].m_bulletFile; + delete m_data->m_savedStates[i].m_serializer; + } + delete m_data; } diff --git a/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.cpp b/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.cpp index 7398d930b..e7de912e6 100644 --- a/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.cpp +++ b/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.cpp @@ -2546,6 +2546,27 @@ void b3RobotSimulatorClientAPI_NoDirect::restoreStateFromMemory(int stateId) statusType = b3GetStatusType(statusHandle); } +void b3RobotSimulatorClientAPI_NoDirect::removeState(int stateUniqueId) +{ + b3PhysicsClientHandle sm = m_data->m_physicsClientHandle; + if (sm == 0) + { + b3Warning("Not connected"); + return; + } + + if (stateUniqueId >= 0) + { + b3SharedMemoryStatusHandle statusHandle; + int statusType; + if (b3CanSubmitCommand(sm)) + { + statusHandle = b3SubmitClientCommandAndWaitStatus(sm, b3InitRemoveStateCommand(sm, stateUniqueId)); + statusType = b3GetStatusType(statusHandle); + } + } +} + bool b3RobotSimulatorClientAPI_NoDirect::getVisualShapeData(int bodyUniqueId, b3VisualShapeInformation& visualShapeInfo) { b3PhysicsClientHandle sm = m_data->m_physicsClientHandle; diff --git a/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h b/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h index 1c92746b4..5de719669 100644 --- a/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h +++ b/examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h @@ -889,6 +889,7 @@ public: int saveStateToMemory(); void restoreStateFromMemory(int stateId); + void removeState(int stateUniqueId); int getAPIVersion() const { |