Best way to "skip" to results

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
BabaJustin
Posts: 30
Joined: Mon Apr 25, 2011 6:07 pm

Best way to "skip" to results

Post by BabaJustin »

Is there a good way to "skip" a physics simulation?

As an example, after a user throws a bowling ball to do all the physics up front, and go directly to the results of which pins are knocked down. Currently I am running the Space.Update in a loop, but this is proving to be too slow in several cases. Is there a better way to advance time in a large amount?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Best way to "skip" to results

Post by Norbo »

In order to know the actual results of a simulation, it must be simulated first; there's no way around it for 'correct' results. You could try tuning the simulation that's supposed to be running invisibly to use lower quality/higher performance settings, but then the behavior will change some.

You may be able to get a little headstart on the simulation process if you begin simulating early, if possible. That is, if the simulation is supposed to begin after a player finishes a move, or after some score screen, or after any delay, the invisible simulation could start updating immediately instead while the player is doing other things.

Another option is to fake it completely. For example, shoot a raycast along the ground to the pins and, for hit pins, apply some destabilizing force and do a mini simulation. This would not capture any of the fine details of an actual simulation, but it might work for some purposes.
Post Reply