testRaySphere
- bool testRaySphere(double originX, double originY, double originZ, double dirX, double dirY, double dirZ, double centerX, double centerY, double centerZ, double radiusSquared)
public static
bool
testRaySphere
- bool testRaySphere(Vector3d origin, Vector3d dir, Vector3d center, double radiusSquared)
doml intersection_d
static functionsstatic variables
Test whether the given ray with the origin <code>(originX, originY, originZ)</code> and normalized direction <code>(dirX, dirY, dirZ)</code> intersects the given sphere with center <code>(centerX, centerY, centerZ)</code> and square radius <code>radiusSquared</code>. <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 originX the x coordinate of the ray's origin @param originY the y coordinate of the ray's origin @param originZ the z coordinate of the ray's origin @param dirX the x coordinate of the ray's normalized direction @param dirY the y coordinate of the ray's normalized direction @param dirZ the z coordinate of the ray's normalized direction @param centerX the x coordinate of the sphere's center @param centerY the y coordinate of the sphere's center @param centerZ the z coordinate of the sphere's center @param radiusSquared the sphere radius squared @return <code>true</code> if the ray intersects the sphere; <code>false</code> otherwise