Best entity for player model

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
nemisis83
Posts: 3
Joined: Thu Aug 25, 2011 2:22 am

Best entity for player model

Post by nemisis83 »

I have the model pulled from the skinned model sample just for quick collision testing. I tried using the mobilemesh entity but the problem i run into is that it for 1 does not collide with the animated mesh and for 2 it doesnt keep balance when you use the gravity set in the space. the player fals down and lays on the ground. my question is what is the best entity to use for the collisions of my player model if i plan on the player being effected by gravity and being able to jump. is there a property to set for the mobilemesh that will help keep the model upright? plese help i know its a dumb question but im lost. thanks alot for any advise you have to offer.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Best entity for player model

Post by Norbo »

Generally, using the simplest possible shape is best. Something like a Capsule would do the trick. The SimpleCharacterController in the BEPUphysicsDemos shows an example: http://bepuphysics.codeplex.com/SourceC ... troller.cs

A full featured character controller (the CharacterController, without the Simple prefix) is also available in the demos.

If you want detailed collision for purposes of raycasting or ragdolls, you should look into other approximations on top of the capsule. Let the capsule handle environmental interaction. Detailed hit detection for rays could be handled by positioning entities using the animation skeleton. Those same entities could be used to ragdoll the character. I would recommend starting out simple, though.
is there a property to set for the mobilemesh that will help keep the model upright? plese help i know its a dumb question but im lost.
Setting a dynamic entity's LocalInertiaTensorInverse = new Matrix3X3() will give it infinite inertia. It will no longer be capable of rotation.
nemisis83
Posts: 3
Joined: Thu Aug 25, 2011 2:22 am

Re: Best entity for player model

Post by nemisis83 »

thanks alot thats exactly the answer i was looking for.
Post Reply