FrustumIntersection.intersectSphere

Determine whether the given sphere is partly or completely within or outside of the frustum defined by <code>this</code> frustum culler. <p> The algorithm implemented by this method is conservative. This means that in certain circumstances a <i>false positive</i> can occur, when the method returns {@link #INTERSECT} for spheres that do not intersect the frustum. See <a href="http://iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm">iquilezles.org</a> for an examination of this problem.

@param x the x-coordinate of the sphere's center @param y the y-coordinate of the sphere's center @param z the z-coordinate of the sphere's center @param r the sphere's radius @return {@link #INSIDE} if the given sphere is completely inside the frustum, or {@link #INTERSECT} if the sphere intersects the frustum, or {@link #OUTSIDE} if the sphere is outside of the frustum

  1. int intersectSphere(Vector3d center, float radius)
  2. int intersectSphere(float x, float y, float z, float r)
    struct FrustumIntersection
    int
    intersectSphere
    (
    float x
    ,
    float y
    ,
    float z
    ,
    float r
    )

Meta