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)); }
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)); }
public static void OnBroke() { Broke?.Invoke(null, EventArgs.Empty); }