public void ConstantPull(ModelEntity entityOne, ModelEntity entityTwo, float forceMag)
 {
     this.ForceRegistry.Add( entityOne, new TowardsBodyFG( entityTwo.Body, forceMag));
     this.ForceRegistry.Add( entityTwo, new TowardsBodyFG( entityOne.Body, forceMag));
 }
Exemple #2
0
        public void Tug(ModelEntity target, Vector3 position)
        {
            float mass = target.Body.Mass;

            float time = 100000;

            Vector3 diff = position - target.CenterOfMass;

            float forceMag = mass * (diff.Length() / time);

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

            diff.Normalize();
            diff *= forceMag;
            target.addForce(diff);
        }
Exemple #4
0
 public void Tug(ModelEntity target)
 {
     Tug(target, Camera.Position);
 }
Exemple #5
0
 public void Tug(ModelEntity target, float forceMag)
 {
     Tug(target, CamBody.Position, forceMag);
 }
Exemple #6
0
 public void Smack(ModelEntity left, float forceMag, float radius)
 {
     left.addForce(TrickyMath.RandVector(Random, forceMag), TrickyMath.RandVector(Random, radius));
 }
Exemple #7
0
 public void Smack(ModelEntity entity, float radius)
 {
     Smack(entity, 0.001f, radius);
 }
Exemple #8
0
 public virtual void Smack(ModelEntity modelEntity)
 {
     Smack(modelEntity, 1f);
 }
Exemple #9
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 #10
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);
        }