mirror of
https://github.com/CedricGuillemet/ImGuizmo.git
synced 2026-01-18 21:21:19 +01:00
precision for rotation improved
This commit is contained in:
@@ -1073,7 +1073,7 @@ namespace ImGuizmo
|
||||
vec_t perpendicularVector;
|
||||
perpendicularVector.Cross(gContext.mRotationVectorSource, gContext.mTranslationPlan);
|
||||
perpendicularVector.Normalize();
|
||||
float acosAngle = Clamp(Dot(localPos, gContext.mRotationVectorSource), -0.9999f, 0.9999f);
|
||||
float acosAngle = Clamp(Dot(localPos, gContext.mRotationVectorSource), -1.f, 1.f);
|
||||
float angle = acosf(acosAngle);
|
||||
angle *= (Dot(localPos, perpendicularVector) < 0.f) ? 1.f : -1.f;
|
||||
return angle;
|
||||
|
||||
Reference in New Issue
Block a user