Page 1 of 1
Simple Room with Physics
Posted: Sun Sep 11, 2011 6:13 am
by uman
Hello
I am fairly new to using BEPU physics and been using XNA for a couple of weeks now and was wondering what was the simplest way to create a room with just a player in the center.
I was thinking creating the room in say a modelling program ( I am fairly familiar with Lightwave 3d) but wasn't sure how to insert it into the space. So far the tutorials I've done are creating the space for BEPU physics to work in and shooting some boxes. Also if it was done it hard code, how would I approach this?
Thanks
Re: Simple Room with Physics
Posted: Sun Sep 11, 2011 6:23 pm
by Norbo
I would recommend checking out the
getting started documentation for a quick look at how to set up level meshes. There's also tons of examples in the BEPUphysicsDemos project source, which is contained in the main source download:
http://bepuphysics.codeplex.com/SourceC ... changesets
For the player, if you want an fps-style character, then look into the BEPUphysicsDemos SimpleCharacterController or CharacterController and how they are used.
Re: Simple Room with Physics
Posted: Tue Sep 13, 2011 1:15 am
by uman
Thanks for the reply,
I looked at the GettingStarted Demo and got some models loading into the world. I'm currently working on simulating weapon fire and explosions using raycasting. If there are any good tutorials on that let me know.
I'm slowly progressing into reading the Demo work but haven't had the time.
Re: Simple Room with Physics
Posted: Tue Sep 13, 2011 3:03 am
by Norbo
There's no tutorials dedicated specifically to weapons fire and explosions, but there is an Explosion class in the demos. It shows how to efficiently query the space using bounding shapes to find intersecting objects which can then be pushed around. Ray casts are a similar query, but test a ray rather than a bounding shape against the acceleration structure. All such queries go through the BroadPhase query system for acceleration, but the Space class offers some convenience wrapper methods around it.
Re: Simple Room with Physics
Posted: Tue Sep 13, 2011 12:31 pm
by uman
Attempting to use raycasting now so when the ray hits an object the explosion should be created at the impact point and explode.