Number of fast moving objects that newton can handle

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Number of fast moving objects that newton can handle

Postby 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

Re: Number of fast moving objects that newton can handle

Postby JernejL » Sun Dec 28, 2008 3:26 pm

Raycasting and Object-casting are probably what you should use for your projectiles.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Number of fast moving objects that newton can handle

Postby 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

Re: Number of fast moving objects that newton can handle

Postby 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.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Number of fast moving objects that newton can handle

Postby 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

Re: Number of fast moving objects that newton can handle

Postby Julio Jerez » Mon Dec 29, 2008 9:59 am

and for the next beta ray cast just had a turbo bust. 8) 8)
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Number of fast moving objects that newton can handle

Postby agi_shi » Mon Dec 29, 2008 12:54 pm

Julio Jerez wrote:and for the next beta ray cast just had a turbo bust. 8) 8)

:shock:

Sounds like I might have to revisit my ray tracer :twisted:
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 16 guests

cron