private void CreateGroundBody() { var jitterGroundBody = new RigidBody(new BoxShape(20000.0f, 20000.0f, PlaneHeight)) { IsStatic = true, Material = { KineticFriction = 0.0f } }; groundBody = new JitterBody(jitterGroundBody); }
public override PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition, float mass, float restitution) { PhysicsBody body = new JitterBody(this, shape, initialPosition, mass, restitution); bodies.Add(body); if (float.IsNaN(body.Position.X) || float.IsNaN(body.AngularVelocity.X) || float.IsNaN(body.BoundingBox.Min.X) || float.IsNaN(body.BoundingBox.Max.X) || float.IsNaN(body.GetOrientation().X)) { throw new PhysicsBodyIsNotSetUpProperlyMakeSurePositionVelocityAndBoundingBoxAreSet(body); } return(body); }
public override PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition, float mass, float restitution) { PhysicsBody body = new JitterBody(this, shape, initialPosition, mass, restitution); bodies.Add(body); if (float.IsNaN(body.Position.X) || float.IsNaN(body.AngularVelocity.X) || float.IsNaN(body.BoundingBox.Min.X) || float.IsNaN(body.BoundingBox.Max.X) || float.IsNaN(body.GetOrientation().X)) throw new PhysicsBodyIsNotSetUpProperlyMakeSurePositionVelocityAndBoundingBoxAreSet(body); return body; }