DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.55k stars 224 forks source link

Sim step slowing down #350

Open ghost opened 1 year ago

ghost commented 1 year ago

I have about 1000 box colliders, but they're all (a) static and (b) not set to collide with each other. However the world step has gotten very slow. Is RP3D not ok with large numbers of objects in general?

programingman commented 1 year ago

Are any of the objects moving? Or is the whole scene static? Can you profile the code to see where time is being spent? Also make sure you're testing a Release build. Debug builds have extra overhead which make the program much slower.

Let me know if you need help figuring out how to profile the program.

ghost commented 1 year ago

They're static. But yes I'm in debug mode. Maybe I need to compile rp3d in release and my code in debug. I'll run gprof though and see what comes out.

ghost commented 1 year ago

Can I disable the debugging stuff while remaining in non-release build?

programingman commented 1 year ago

You can enable optimization (eg -O2 or -O3) on the rp3d Debug library, but mixing Debug and Release builds isn't recommended, if it will compile at all.

ghost commented 1 year ago

Thanks. I turned off debug drawing - are there any other options like that I might have missed that are on by default?

ZeunO8 commented 1 year ago

Try profiling with the orbit profiler to find out where most of the time is being spent.!

DanielChappuis commented 5 months ago

Have you already tried the last release of the library (version v0.10.0)?. I have made a change that has improved a lot the performance of static bodies.