Applying two impulses at the same frame produces drift.
My Setup:
Code: Select all
phyBody = new Box(Vector3.Zero, 80, 100, 600,10);
phyBody.AngularDamping = 0f;
phyBody.LinearDamping = 0f;
space.Add(phyBody);
Code: Select all
worldPosition =
phyBody.InternalCenterOfMass + Vector3.TransformNormal(new Vector3(0, 0, -phyBody.HalfLength),
phyBody.InternalOrientationMatrix);
worldDirection =
Vector3.TransformNormal(Vector3.Left, phyBody.InternalOrientationMatrix);
phyBody.ApplyImpulse(worldPosition, worldDirection*speedLimit);
worldPosition =
phyBody.InternalCenterOfMass + Vector3.TransformNormal(new Vector3(0, 0, phyBody.HalfLength),
phyBody.InternalOrientationMatrix);
worldDirection =
Vector3.TransformNormal(Vector3.Right, phyBody.InternalOrientationMatrix);
phyBody.ApplyImpulse(worldPosition, worldDirection*speedLimit);
The effect should be a nice turn on the spot but it drifts off to the side(-x), my theory is that by applaying the first impulse i change the orientation and the second impulse is firing in a different direction and cant counter the first one.
My question is: is there a way to apply them simultaneous?
btw. great work with the engine so far.