Пример #1
0
 public Quaternion GetRelativeQuaternion()
 {
     if (InVehicle && Vehicle != null && Vehicle is ModelEntity && (Vehicle as ModelEntity).Plane != null)
     {
         return(Vehicle.GetOrientation());
     }
     return(Quaternion.Identity);
 }
Пример #2
0
 public JointForceWeld(Entity one, Entity two)
 {
     One = one;
     Two = two;
     Matrix worldTrans = Matrix.CreateFromQuaternion(One.GetOrientation()) * Matrix.CreateTranslation(One.GetPosition().ToBVector());
     Matrix.Invert(ref worldTrans, out worldTrans);
     Relative = (Matrix.CreateFromQuaternion(two.GetOrientation())
         * Matrix.CreateTranslation(two.GetPosition().ToBVector()))
         * worldTrans;
 }
Пример #3
0
 public Quaternion GetRelativeQuaternion()
 {
     if (InPlane())
     {
         return(Vehicle.GetOrientation());
     }
     else if (AutoGravityScale > 0.0)
     {
         Vector3 up       = Vector3.UnitZ;
         Vector3 antigrav = -Body.Gravity.Value;
         antigrav.Normalize();
         Quaternion.GetQuaternionBetweenNormalizedVectors(ref antigrav, ref up, out Quaternion q);
         return(q);
     }
     return(Quaternion.Identity);
 }
Пример #4
0
 public BEPUutilities.Quaternion GetRelativeQuaternion()
 {
     if (InPlane() && TheClient.CVars.g_firstperson.ValueB)
     {
         return(Vehicle.GetOrientation());
     }
     else if (AutoGravityScale > 0.0)
     {
         Vector3 up       = Vector3.UnitZ;
         Vector3 antigrav = -Body.Gravity.Value;
         antigrav.Normalize();
         BEPUutilities.Quaternion.GetQuaternionBetweenNormalizedVectors(ref antigrav, ref up, out BEPUutilities.Quaternion q);
         return(q);
     }
     return(BEPUutilities.Quaternion.Identity);
 }