Hi,
I'm following the wiki and when I create and add the body to the world I can't find the method to draw it. I wrote this method (that already contains the call to draw Box)
protected override void OnBeginRender(double elapsedTime)
{
foreach (RigidBody body in world.RigidBodies)//for every rigid body in the world
{
if (body.Shape is BoxShape)
{
BoxShape shape = body.Shape as BoxShape;
dsDrawBox(body.Position, body.Orientation, shape.Size);
}
else if(body.Shape is CompoundShape)
{
CompoundShape shape = body.Shape as CompoundShape;
//What is the method to call here? In the library there isn't dsDrawCompoundShape(...)
}
}
world.Step(1.0f / 100.0f, true);
}
You have to implement your own drawing code for CompoundShapes. This includes looping over all the shapes the compound shape is made of and draw them one by one at the correct position and orientation.
Hi, I'm following the wiki and when I create and add the body to the world I can't find the method to draw it. I wrote this method (that already contains the call to draw Box)
Thakyou for the help.