Hi Anton, thank you for replying and giving those good advices

1. I do not understand your statement "unstable"/"stable with threads". Do you mean that my application already uses threads or that it is "safe" using threads? I also think threads impact the performance a bit :p. Thank you

2. Thanks for the tip
3. I already knew this by searching on the internet :p
4. I think my NewtonBodies were already enabled with auto-sleep (but I now added NewtonBodySetAutoSleep when they were initialized so thanks :p)
5. I never understood and heard what simulation islands were(except by seeing it in the source of newton) and what they were used for but I think from what you said, it could be quite interesting to use them by approximating even more the physics for objects that are not in the camera view. Thanks

. However, I think that excluding the entire bodies from being updated might be too much for the project I am trying to make which is an RTS game (the genre of Starcraft I and II but with space included, if you see what I mean).
Thank you very much for the advices you gave me

. I will try to look the simulation islands in more depth.
PS: if ever Newton needs some acceleration structures, I found some quite interesting research papers on creating BVH (quickly) while searhing to implement photon mapping (which is a bit too complicated for me). Here are the links:
BVH creation -
https://research.nvidia.com/publication ... -k-d-treesRadix Sorting on the GPU with source code (on CUDA though :/ ) -
https://code.google.com/p/back40computi ... dixSortingEdit: I tested the code given in the link but there is a problem because when the objects are not in the camera frustum and they get into the camera frustum they are not updated to the current frame but to the frame they should have done one frame after if not behind the frustum. By that, I mean that if the newtonbody is behind the frustum for let's say 10 frames and then he gets back into the frustum, he will act as if only one frame has passed and not the 10 frames. Is it possible to change this behavior? Like by running NewtonUpdate not with the difference of time between each frame or 1 but with a timer which would resolve the island issue (or normal behavior).
For example, we would do this:
- Code: Select all
NewtonUpdate(world, timer.elapsed()/*since the first frame*/);
and not:
- Code: Select all
NewtonUpdate(world, timer.elapsed()/*since the last frame*/);
(which can also allow us to go in the past

for replays)
Thank you
