Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cast to float in getAngleAroundRad calculation, because before it ... #2364

Merged
merged 3 commits into from Sep 27, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -847,7 +847,7 @@ public void getSwingTwist (final Vector3 axis, final Quaternion swing, final Qua
public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) {
final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ);
final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w);
return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(this.w / Math.sqrt(l2)));
return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(MathUtils.clamp((float) (this.w / Math.sqrt(l2)), -1f, 1f)));
}

/** Get the angle in radians of the rotation around the specified axis. The axis must be normalized.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.