XNA racing game and bepu

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Christian24
Posts: 1
Joined: Mon Jul 05, 2010 6:32 pm

XNA racing game and bepu

Post by Christian24 »

Hello everybody,

I am quite new to Bepu Physics, I just started to use it. I wanted to know if anyone had tried to get bepu physics integrated into the XNA Racing Starter Kit? How would you approach it and how difficult would it be?

Thanks,
Christian
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XNA racing game and bepu

Post by Norbo »

While I haven't created a demo with the XNA racing starter kit, the base idea is relatively simple. You'll need to set up a vehicle (an example of which can be found in the BEPUphysicsDemos' VehicleInput class) and create a world to drive around in.

You can check the BEPUphysicsDemos Terrain (#4) or StaticTriangleGroup (#28) demos for two fairly simple ways to create a world. In the starter kit, there's probably a model or set of models that compose the track that you drive on. You would need to create a StaticTriangleGroup to manage the collision mesh.

Note that the starter kit was designed for a non-physical car. If I remember right, there's one area that has a vertical loop in the track; driving around that with a car that sticks to the road is relatively easy, but a lot trickier if you actually have to obey physics.

Furthermore, the physics engine has a few requirements about the content it manages. Due to limited precision in floating point numbers, content needs to be kept within reasonable limits. 0.5 to 10 units per entity is a good safe target, though the engine can generally handle values well outside of that range. Pushing the engine to work with giant, 1000x1000 triangles will probably cause some issues. The content in the starter kit may or may not fit the requirements by default, though the issues can be addressed by re-scaling things.

So, integrating BEPUphysics into the starter kit may be fairly easy or fairly annoying depending on how it's set up. If you want a relatively easy project, you can try fiddling around with importing custom models to the BEPUphysicsDemos and experiment with vehicle properties.
Post Reply