testRaySphere

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

  1. bool testRaySphere(double originX, double originY, double originZ, double dirX, double dirY, double dirZ, double centerX, double centerY, double centerZ, double radiusSquared)
    static
    bool
    testRaySphere
    (
    double originX
    ,
    double originY
    ,
    double originZ
    ,
    double dirX
    ,
    double dirY
    ,
    double dirZ
    ,
    double centerX
    ,
    double centerY
    ,
    double centerZ
    ,)
  2. bool testRaySphere(Vector3d origin, Vector3d dir, Vector3d center, double radiusSquared)

Meta