summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerwincoumans <erwin.coumans@gmail.com>2023-02-24 10:32:04 -0800
committerGitHub <noreply@github.com>2023-02-24 10:32:04 -0800
commitc037d9ba279d74c7e7437a700763892a6ba75760 (patch)
tree1426b7ed3225cd8da87f20e1596101c01a141760
parent2c204c49e56ed15ec5fcfa71d199ab6d6570b3f5 (diff)
parent8549f00502217a66e679231e72da190c9951a2b2 (diff)
downloadbullet3-c037d9ba279d74c7e7437a700763892a6ba75760.tar.gz
Merge pull request #4382 from ManuCorrea/fix-points
Added fix for deleting debug points with life time.
-rw-r--r--README.md2
-rw-r--r--examples/SharedMemory/PhysicsServerExample.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/README.md b/README.md
index 44f222a6e..d8009db5a 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ p.connect(p.SHARED_MEMORY) #or (p.TCP, "localhost", 6667) or (p.UDP, "192.168.86
**Linux and Mac OSX gnu make**
-Make sure cmake is installed (sudo apt-get install cmake, brew install cmake, or https://cmake.org)
+Make sure gcc and cmake is installed (`sudo apt-get install build-essential` and `sudo apt-get install cmake` for Linux, `brew install cmake` for Mac, or https://cmake.org)
In a terminal type:
```
diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp
index 2d2416c8e..52c30dee5 100644
--- a/examples/SharedMemory/PhysicsServerExample.cpp
+++ b/examples/SharedMemory/PhysicsServerExample.cpp
@@ -2799,6 +2799,20 @@ void PhysicsServerExample::stepSimulation(float deltaTime)
}
}
}
+
+ for (int i = m_multiThreadedHelper->m_userDebugPoints.size() - 1; i >= 0; i--)
+ {
+ if (m_multiThreadedHelper->m_userDebugPoints[i].m_lifeTime)
+ {
+ m_multiThreadedHelper->m_userDebugPoints[i].m_lifeTime -= deltaTime;
+ if (m_multiThreadedHelper->m_userDebugPoints[i].m_lifeTime <= 0)
+ {
+ m_multiThreadedHelper->m_userDebugPoints.swap(i, m_multiThreadedHelper->m_userDebugPoints.size() - 1);
+ m_multiThreadedHelper->m_userDebugPoints.pop_back();
+ }
+ }
+ }
+
updateGraphics();