Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Isn't there a way, to force BEPUphsyics to show what it is doing? I am here with my existing XNA project, starting to put in BEPUphysics, but I am not seeing what it is doing.

Take my model for instance. I think I made a StaticMesh here:

public BEPUphysics.Collidables.StaticMesh PhysicsMesh;
public Space space;
private Hero _hero;

public override void LoadContent()
{
   //...

   space = new Space(); 
   Vector3[] vertices;
   int[] indices;
   TriangleMesh.GetVerticesAndIndicesFromModel(_model.getCoreModel(), out vertices, out indices);
   PhysicsMesh = new BEPUphysics.Collidables.StaticMesh(vertices, indices, new AffineTransform(new Vector3(0, -40, 0)));

   space.Add(_hero.PhysicsMesh);
   space.ForceUpdater.Gravity = new Vector3(0, -9.81f, 0);
}

That's the only thing I made BEPU-Wise in my game. All other models don't have physics attached to them.

But, like I said. I see nothing when the game is running. Only my model, not falling, not doing anything.

I would like to see the full thing BEPU is doing in runtime.

share|improve this question
add comment

1 Answer

Drawing bounding boxes is a good solution, I have found. When I integrated BEPU into my engine I added code to do two things:

  1. Draw the bounding box of the model in a certain color.

  2. Draw the bounding box of the physics objects in another color.

This really helped me to find all the various issues between the two*, and makes the positions quite clear. You'll have to do a bit to construct a bounding box from the static mesh, but it isn't too bad.

  • Importantly, the origin point of the static mesh made from your model will likely not be the same as the origin of the model. Rather it will be the 'center' of the object, vs the origin assigned in the modeling program. You'll likely need to figure out the offset between the two and draw the model with the offset so it is at the proper position per the physics object.
share|improve this answer
    
Btw, here's a good post on how to construct the bounding boxes:bounding-boxes-for-your-model-meshes –  DrHeinous Apr 24 '13 at 18:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.