Closed GoogleCodeExporter closed 8 years ago
Using the code below I get a distance of 20.0 which appears to be correct. This
is before I made the change you suggested. I'm not an expect though, so more
input would be nice.
Plane plane = new Plane(new Vector3(0, -1, 0), 10);
Ray ray = new Ray(new Vector3(0, 10, 0), new Vector3(0, -1, 0));
float distance;
Collision.RayIntersectsPlane(ref ray, ref plane, out distance);
Original comment by Jorgy...@gmail.com
on 26 Mar 2011 at 6:45
The exemple you have gived seemed also mistake.
Plane plane = new Plane(new Vector3(0, -1, 0), 10);
Ray ray = new Ray(new Vector3(0, 10, 0), new Vector3(0, -1, 0));
The distance should be 0 not 20 , The plane cross (0, 10, 0), which the start
point of the ray.
Try below:
Ray ray = new Ray(new Vector3(0, 10, 0), new Vector3(0, -1, 0));
Plane plane = new Plane(new Vector3(0, 1, 0), 20);
result = SlimMath.Collision.RayIntersectsPlane(ref ray, ref plane, out
distance);
Now the result is false. The correct result is true and disantce is 30.
Original comment by Jumping....@gmail.com
on 27 Mar 2011 at 11:37
I committed your fix in r46. Thank you!
Original comment by Jorgy...@gmail.com
on 27 Mar 2011 at 7:32
Original issue reported on code.google.com by
Jumping....@gmail.com
on 9 Mar 2011 at 9:02