升级obi

This commit is contained in:
2026-01-22 22:08:21 +08:00
parent 120b8cda26
commit 20f14322bc
1067 changed files with 149894 additions and 29583 deletions

View File

@@ -39,7 +39,9 @@ namespace Obi
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4 DifferentiateAngular(quaternion rotation, quaternion prevRotation, float dt)
{
return new float4((math.mul(rotation, math.inverse(prevRotation)).value * 2.0f / dt).xyz, 0);
quaternion deltaq = math.mul(rotation, math.inverse(prevRotation));
float sign = deltaq.value.w >= 0 ? 1 : -1;
return new float4(sign * deltaq.value.xyz * 2.0f / dt, 0);
}
}
}