A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by jargo » Sun Dec 28, 2008 1:50 pm
I am writing a game that is a 3d space shooter with newtonian physics. In the game I need to have up to 1000 m/s moving objects. With objects moving this fast I need to use either continuous collision mode or run the physics engine at 1000 fps to prevent objects from passing through each other on collisions. The problem with this is that I can only add about 200 simple box-shaped objects to the world before the fps drops below playable level. Is there some kind of "magic trick" with what I could add more fast moving objects to world without the fps dropping too much, or do I need to abandon this project ? The collisions would not need to be that accurate the main thing is that collisions would always be detected.
Another related question which basic form is faster on checking if collision has accured ,a box or sphere?
-
jargo
-
- Posts: 3
- Joined: Thu Nov 13, 2008 4:20 pm
by JernejL » Sun Dec 28, 2008 3:26 pm
Raycasting and Object-casting are probably what you should use for your projectiles.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by jargo » Mon Dec 29, 2008 5:14 am
Delfi wrote:Raycasting and Object-casting are probably what you should use for your projectiles.
Is running 1000 raycast calculations per frame faster than having 1000 fastmoving objects in the world with continuous collision mode turned on?
-
jargo
-
- Posts: 3
- Joined: Thu Nov 13, 2008 4:20 pm
by JernejL » Mon Dec 29, 2008 8:53 am
I'm not qualified to say that and i have no time to generate a benchmark to see what is faster, so i suggest you try, but i'd guess 1000 raycasts would be a lot faster since it doesn't generate contacts between colliding bodies.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by agi_shi » Mon Dec 29, 2008 8:54 am
Yes, much faster. I used ray casts all over the place in my ray tracer - at 128x128 (16384 ray casts each frame) it ran at practically 60 FPS, so 1000 ray casts should be nothing.
-
agi_shi
-
- Posts: 263
- Joined: Fri Aug 17, 2007 6:54 pm
by agi_shi » Mon Dec 29, 2008 12:54 pm
-
agi_shi
-
- Posts: 263
- Joined: Fri Aug 17, 2007 6:54 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 21 guests