-
-
Save alecmce/415218 to your computer and use it in GitHub Desktop.
var ray:Ray3D = new Ray3D(0, 0, -140, 0, 0, 100); | |
var sphere:Sphere3D = new Sphere3D(40, 0, 0, 0); | |
var alpha:Number = sphere.intersectRay(ray); | |
trace(alpha); | |
// outputs 0.6428719030100183 | |
is the output correct with normalized direction vector yes or no? If not please file a bug report http://code.google.com/p/papervision3d/issues/list Jeez.
Yes. The output is fine with a normalized vector. I've calmed down a bit now, though I'm going to have to work late because of the delay all this caused me, but I still really think that some documentation would be helpful in these circumstances. Take the matrix3D..copy(matrix3D):Matrix3D function. Which one is copied to which? Which one is returned? It's an absolutely fine and flexible API to have, but only if it's well documented. I feel like I code at less than half my normal pace just because documentation doesn't exist. As it happens, I don't document internal project code either, but I sure-as-hell document public APIs. Jeez indeed.
Okay, documentation isn't what it should be. Point taken. But, its open source, so guess you simply have to live with some limitations. Can understand your frustration though, sorry ;-)
The Sphere3D.intersectRay code must have been copied-and-pasted into the Sphere3D. It is fast code that contains the underlying assumption that the Ray3D's vector (i.e. the last three parameters) are normalized, which in this case, they are clearly not. Documentation? None. Inline comments in the source code? None. Waste of my time? Complete and utter. Thanks a bunch.