almost default scene which i have added a physics space too and added a box entity to the space. i am then drawing my model (Which is
rendered using my own quick model class) at the centre of mass of the entity in the physics space hoping that this would update each
cycle and the ox would sloly fall due to gravity. the entity itself is not moving at all and i am lost as to why.
this is my initialization of the physics system, like i said i am just using demo code:
and in my update function i am just calling space.Update(gameTime)
Code: Select all
protected override void Initialize()
{
gameCamera = new Camera();
ground = new GameObject();
displayCube = new GameObject();
//physics
space = new Space(new PersistentUniformGrid(10));
space.simulationSettings.gravity = new Vector3(0, -9.81f, 0f); //If left unset, the default value is (0,0,0).
space.simulationSettings.timeScale = 1f; //If left unset, the default value is 1.
space.simulationSettings.iterations = 15; //If left unset, the default value is 15.
//Fiddling with margins and position correction is one way to tune the engine for the specific game/simulation.
space.simulationSettings.defaultMargin = .04f;//Defaults to .04f
space.simulationSettings.defaultAllowedPenetration = .025f;//Defaults to .025f
space.simulationSettings.useSplitImpulsePositionCorrection = false; //Defaults to false.
toAddBox = new Box(new Vector3(0, 10, -5), 5.0f, 5.0f, 5.0f);
//toAddBox.isPhysicallySimulated = true;
space.add(toAddBox);
space.entities[0].isAlwaysActive = true;
space.entities[0].applyLinearImpulse(new Vector3(0,0.05f,0));
base.Initialize();
}
i was under the impression the entity would be affected by gravity and just start falling, am i wrong? have i set something up wrong?
Thanks for any answers,
Bobbin