UnitySteer icon indicating copy to clipboard operation
UnitySteer copied to clipboard

Fixed a bug that would incorrectly calculate the intersection points in SteerForSphericalObstacles

Open CowboyCoderForever opened this issue 7 years ago • 1 comments

I believe the Pythagorean theorem code should have a subtraction, not an addition. While debug rendering the calculated intersection points, the original code could generate points that were wildly off. Changing the formula now generates the intersection points directly on the radius of the sphere/circle.

This might not have much impact on obstacle avoidance (the original points would indeed steer the vehicle away from the obstacle) but it should allow the vehicles to have a closer tolerance to the obstacle.

CowboyCoderForever avatar Mar 29 '17 21:03 CowboyCoderForever

Note - the code in the Ray-Sphere intersection method aligns nicely with this page: http://kylehalladay.com/blog/tutorial/math/2013/12/24/Ray-Sphere-Intersection.html

CowboyCoderForever avatar Mar 29 '17 21:03 CowboyCoderForever