BoundingBoxDrawer not working for me
Posted: Thu Feb 02, 2012 5:29 pm
Hi,
I am new to Bepu and am just trying to get a simple demo working with different sized boxes (with "Box" collision meshes) falling to the ground, I am trying to use TriangleMesh for constructing the ground's collision mesh.
This isn't working, and when the boxes are small they seem to fall through other boxes so I thought I'd try using the BoundingBoxDrawer from the demos to draw the bounding boxes of the objects.
My problem is the BoundingBoxDrawer doesn't seem to be drawing anything.
Here are the important parts of my code:
I am adding the collisions to Space fine and when I step into BoundingBoxDrawer.Draw() there are elements in Space.Entities.
Is there something with my camera and where the BoundingBoxDrawer thinks it should be creating the World Matrix?
Any ideas anyone?
Thanks for your time,
Poncho
I am new to Bepu and am just trying to get a simple demo working with different sized boxes (with "Box" collision meshes) falling to the ground, I am trying to use TriangleMesh for constructing the ground's collision mesh.
This isn't working, and when the boxes are small they seem to fall through other boxes so I thought I'd try using the BoundingBoxDrawer from the demos to draw the bounding boxes of the objects.
My problem is the BoundingBoxDrawer doesn't seem to be drawing anything.
Here are the important parts of my code:
Code: Select all
//At the top
//#Bepu
Space space;
BoundingBoxDrawer bepuBoundingBoxDrawer;
BasicEffect bepuDrawer;
//...in Initialize() :
//#Bepu
space = new Space();
space.ForceUpdater.Gravity = new Vector3(0, -9.81f, 0);
bepuBoundingBoxDrawer = new BoundingBoxDrawer(this);
bepuDrawer = new BasicEffect(GraphicsDevice);
//...in Draw() :
bepuDrawer.LightingEnabled = false;
bepuDrawer.VertexColorEnabled = true;
bepuDrawer.World = Matrix.Identity;
bepuDrawer.View = CurrentCamera.View;
bepuDrawer.Projection = CurrentCamera.Projection;
bepuBoundingBoxDrawer.Draw(bepuDrawer, space);
Is there something with my camera and where the BoundingBoxDrawer thinks it should be creating the World Matrix?
Any ideas anyone?
Thanks for your time,
Poncho