testRaySphere
- bool testRaySphere(double originX, double originY, double originZ, double dirX, double dirY, double dirZ, double centerX, double centerY, double centerZ, double radiusSquared)
- bool testRaySphere(Vector3d origin, Vector3d dir, Vector3d center, double radiusSquared)
public static
bool
testRaySphere
doml intersection_d
static functionsstatic variables
Test whether the ray with the given <code>origin</code> and normalized direction <code>dir</code> intersects the sphere with the given <code>center</code> and square radius. <p> This method returns <code>true</code> for a ray whose origin lies inside the sphere. <p> Reference: <a href="http://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-sphere-intersection">http://www.scratchapixel.com/</a>
@param origin the ray's origin @param dir the ray's normalized direction @param center the sphere's center @param radiusSquared the sphere radius squared @return <code>true</code> if the ray intersects the sphere; <code>false</code> otherwise