Exemplo n.º 1
0
 public Vector3 ComputeRelativeForce(Vector3 force)
 {
     if (thing != null)
     {
         return(MathI.RotateVector(force, Vector3.zero, thing.rotation));
     }
     return(Vector3.zero);
 }
Exemplo n.º 2
0
 public void ApplyForce(Vector3 thrustVector, Vector3 offset, bool relativeToRotation = true)
 {
     if (thing != null)
     {
         Vector3 point = offset;
         Vector3 force = thrustVector;
         if (relativeToRotation)
         {
             ApplyForceAndTorque(ComputeRelativeForce(thrustVector), ComputeTorque(thrustVector, offset));
             force = ComputeRelativeForce(thrustVector);
         }
         else
         {
             ApplyForceAndTorque(thrustVector, ComputeTorque(thrustVector, offset));
         }
         Vector3 tPt = MathI.RotateVector(thing.position + centerOfMass + point, thing.position + centerOfMass, thing.rotation);
     }
 }
Exemplo n.º 3
0
 private static void CheckTickLists()
 {
     foreach (int i in TickerList.Keys)
     {
         if (MathI.isAMultiple(curTick, i))
         {
             List <Tickable> currentList = TickerList [i];
             if (currentList.Count > 0)
             {
                 foreach (Tickable tickable in currentList)
                 {
                     tickQue.Add(tickable);
                     if (tickable.Interval != i)
                     {
                         RemoveTicker(tickable);
                         AddTicker(tickable);
                     }
                 }
             }
         }
     }
 }