Exemple #1
0
        public void Tug(ModelEntity target, Vector3 position, float forceMag)
        {
            Vector3 diff = position - target.CenterOfMass;

            diff.Normalize();
            diff *= forceMag;
            target.addForce(diff);
        }
Exemple #2
0
 public void PushTogether(ModelEntity left, ModelEntity right, float forceMag)
 {
     Vector3 midLine = left.CenterOfMass - right.CenterOfMass;
     midLine.Normalize();
     midLine *= forceMag;
     left.addForce(-midLine);
     right.addForce(midLine);
     left.Body.Awake = true;
     right.Body.Awake = true;
 }
Exemple #3
0
 public void Smack(ModelEntity left, float forceMag, float radius)
 {
     left.addForce(TrickyMath.RandVector(Random, forceMag), TrickyMath.RandVector(Random, radius));
 }
Exemple #4
0
        public void PushApart(ModelEntity left, ModelEntity right, float forceMag)
        {
            Vector3 midLine = left.CenterOfMass - right.CenterOfMass;
            midLine.Normalize();
            midLine *= forceMag;

            left.addForce(midLine);
            right.addForce(-midLine);
        }