Comments (3)
Here's how things look like when the contacts are updated even if the demo's paused (when contact updating is done outside the context of simulating any time):
I like this view better. What I'm looking at looks more sensible to me.
Having the engine work this way changes some performance characteristics though. It means contacts get updated whether or not their associated bodies moved. I had thought of that as an algorithmic optimization. It kept some contact manifolds from getting regenerated at the expense of a conditional branch (and presumably branch mis-prediction costs). I haven't noticed any actual repeatable performance changes either way though. I suspect that's situational to the sim being benchmarked too.
Having the engine work this way also means that contact add state information isn't persistently available anymore to the Testbed when using Single Step to go through a sim a time-step at a time. The green dots for add states flash (for a refresh frame) and then go to the blue color. I don't like this behavior.
from playrho.
I think the better way to handle contact information w.r.t. the world step would be:
- IFF the world was marked dirty, then update contact information.
- IFF the world step is told to simulate some time, then
- Do regular phase handling.
- Do TOI phase handling.
- Update contact information.
This way, contact information matches the state of bodies whether the contact info is accessed by PreSolve
handlers, or by user code after any world step (regardless of whether the step was to sim any time). And this should preserve the add states for single-stepping through sims in the Testbed.
Unfortunately the Collision Processing
Testbed Test
causes crashes sometimes (seemingly due to misuse of dynamic memory) with this algorithm implemented and Contact information being displayed. Some of the contact point information which the Test
base class builds using its PreSolve
method gets invalidated. This brings up another tangent consideration, getting rid of the remaining uses of naked pointers to dynamic memory and instead using RAII managed memory.
I'm putting this "better way" algorithm on hold for the time being.
from playrho.
Interesting. If I enable the display of all the Contact info in Erin's Box2D and cycle through the Testbed tests, I eventually get a SIGABRT
too. For Erin's code I get a message of:
Testbed(24806,0x100197000) malloc: *** error for object 0x102b4a240: pointer being freed was not allocated
PlayRho uses RAII more for managing dynamic memory but not entirely.
from playrho.
Related Issues (20)
- UnitVec isn't generalized to N dimensions
- Testbed Test subclasses all in header files
- "vector<bool> subscript out of range" in WorldImpl HOT 5
- PlayRho and LiquidFun
- Remove all public functions that take a non-const Body reference. HOT 3
- CMake: export of targets not used at all in config file HOT 2
- Fix code scanning alert - Returning stack-allocated memory HOT 1
- Some unit test failures on Apple M2 Silicon
- UnderlyingValue deprecated warnings in release 1.1.0 Testbed build
- Release 1.1.0 Testbed warns about using OpenGL functions on macOS deprecated since 10.14
- Warnings on building Testbed from uses of *sprintf
- benchmark submodule not based on v1.7.1 or newer
- AppVeyor doesn't run for release-1.1.1 branch HOT 1
- Get*JointConf functions incorrectly marked noexcept
- Checked class template support for non-throwing for known valid values HOT 1
- Performance regression introduced or former bug fixed? HOT 1
- Use custom container allocators in WorldImpl HOT 3
- Move WorldImpl under detail namespace HOT 1
- Move Island under detail namespace HOT 1
- CMake fix in install rules HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playrho.