CultMath: clamp_twist's NaN guard is one post-wrap check
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 28m39s
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 28m39s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a66b28429d
commit
e2afa3f31b
1 changed files with 0 additions and 1 deletions
|
|
@ -110,7 +110,6 @@ public static partial class math
|
|||
public static quaternion clamp_twist(quaternion twist, float3 unitAxis, float min, float max)
|
||||
{
|
||||
var angle = 2.0f * atan2(dot(vec(twist), unitAxis), twist.w);
|
||||
if (float.IsNaN(angle) || float.IsNaN(min) || float.IsNaN(max)) return new quaternion(float.NaN, float.NaN, float.NaN, float.NaN);
|
||||
const float pi = MathF.PI;
|
||||
if (max - min >= 2.0f * pi) return twist;
|
||||
var centre = 0.5f * (min + max);
|
||||
|
|
|
|||
Loading…
Reference in a new issue