Example #1
0
        internal void Validate(GGame.Math.Fix64 invDt)
        {
            if (!Enabled)
            {
                return;
            }

            GGame.Math.Fix64 jointErrorSquared = GetReactionForce(invDt).LengthSquared();

            if (Fix64.Abs(jointErrorSquared) <= _breakpointSquared)
            {
                return;
            }

            Enabled = false;

            Broke?.Invoke(this, (GGame.Math.Fix64)Fix64.Sqrt(jointErrorSquared));
        }
Example #2
0
        internal void Validate(float invDt)
        {
            if (!Enabled)
            {
                return;
            }

            float jointErrorSquared = GetReactionForce(invDt).LengthSquared();

            if (Math.Abs(jointErrorSquared) <= _breakpointSquared)
            {
                return;
            }

            Enabled = false;

            Broke?.Invoke(this, (float)Math.Sqrt(jointErrorSquared));
        }
Example #3
0
 public static void OnBroke()
 {
     Broke?.Invoke(null, EventArgs.Empty);
 }