コード例 #1
0
 public void invoke(ForceAppliedEvent eventObject)
 {
     if (isEnabled && isPhysicsEnabled)
     {
         Vector2 angleDirection = UtilMethods.angleToDirection(eventObject.Angle);
         this.externalForces += new Vector2(angleDirection.X * eventObject.Magnitude,
             angleDirection.Y * eventObject.Magnitude);
     }
 }
コード例 #2
0
 public void invoke(ForceAppliedEvent eventObject)
 {
     if (isEnabled && isPhysicsEnabled)
     {
         Vector2 angleDirection = UtilMethods.angleToDirection(eventObject.Angle);
         angleDirection.X = (float)Math.Round(angleDirection.X, 6);
         angleDirection.Y = (float)Math.Round(angleDirection.Y, 6);
         this.externalForces.X = this.externalForces.X + (angleDirection.X * eventObject.Magnitude);
         this.externalForces.Y = this.externalForces.Y + (angleDirection.Y * eventObject.Magnitude);
     }
 }