Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.3.0f3
Issue ID
984952
Regression
No
Vector3.Slerp returns imprecise result if 2nd vector has smaller values than the first one
To reproduce:
1. Open repro project
2. Open test runner
3. Run all tests
Expected: 'Vector3Slerp_tIs1_ResultIsb' test will return (3.0000000, 2.0000000, 1.0000000) value
Actual: (3.0000000, 2.0000000, 0.9999997) is returned (z value in 1st vector was larger than in 2nd)
Reproduced: 5.6.5f1, 2017.1.2p4, 2017.2.1p1, 2017.3.0p1, 2018.1.0b1
Note: issue does not occur if 1st vector values are equal or smaller than second vector values
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
The Vector3 functions cannot guarantee exact float return values and floats should always be compared using functions such as Mathf.Approximately.
If exact results are required in this case consider amending code to check for 0/1 values of t first:
if (t<=0) result = a;
else if (t>=1) result = b;
else result = Vector3.Slerp(a, b, t);