public virtual void UpdateForce(RigidBody body, float duration) { }
Beispiel #2
0
 void addboat()
 {
     buoyancy = new Buoyancy(1.0f, 3.0f, 1.6f, 1000, new Disque.Math.Vector3(0, 0.5f, 0));
     sail = new Aero(new D.Matrix3(new float[]{ 0,0,0, 0,0,0, 0,0,-1.0f}), new D.Vector3(2.0f, 0, 0), windspeed);
     cube = new Cube(new Vector3(0, 30, 0), 3, 3, 3, Color.Blue, GraphicsDevice);
     drawables.Add(cube);
     body = new RigidBody();
     body.SetOrientation(new Disque.Math.Quaternion(1, 0, 0, 0));
     body.LinearDrag = 0.8f;
     body.AngularDrag = 0.8f;
     body.Position = new Disque.Math.Vector3(0, 1.6f, 0);
     body.Mass = 200;
     D.Matrix3 it = new D.Matrix3();
     it.SetBlockInertiaTensor(new D.Vector3(1.5f, 1.5f, 1.5f), 100.0f);
     body.BoundingSphere = new D.BoundingSphere(body.Position, 1.5f);
     body.SetInertiaTensor(it);
     body.CalculateDerivedData();
     body.SetAwake();
     body.SetCanSleep(true);
     body.ForceGenerators.Add(buoyancy);
     body.ForceGenerators.Add(sail);
     rbw.RigidBodies.Add(body);
 }