Class IntersectionState


  • public final class IntersectionState
    extends java.lang.Object
    This class is used to store ray/object intersections. It also provides additional data to assist AccelerationStructure objects with traversal.
    • Field Detail

      • time

        float time
      • u

        float u
      • v

        float v
      • w

        float w
      • id

        int id
      • numEyeRays

        long numEyeRays
      • numShadowRays

        long numShadowRays
      • numReflectionRays

        long numReflectionRays
      • numGlossyRays

        long numGlossyRays
      • numRefractionRays

        long numRefractionRays
      • numRays

        long numRays
    • Constructor Detail

      • IntersectionState

        public IntersectionState()
        Initializes all traversal stacks.
    • Method Detail

      • getTime

        public float getTime()
        Returns the time at which the intersection should be calculated. This will be constant for a given ray-tree. This value is guarenteed to be between the camera's shutter open and shutter close time.
        Returns:
        time value
      • hit

        public final boolean hit()
        Checks to see if a hit has been recorded.
        Returns:
        true if a hit has been recorded, false otherwise
      • setIntersection

        public final void setIntersection​(int id)
        Record an intersection with the specified primitive id. The parent object is assumed to be the current instance. The u and v parameters are used to pinpoint the location on the surface if needed.
        Parameters:
        id - primitive id of the intersected object
      • setIntersection

        public final void setIntersection​(int id,
                                          float u,
                                          float v)
        Record an intersection with the specified primitive id. The parent object is assumed to be the current instance. The u and v parameters are used to pinpoint the location on the surface if needed.
        Parameters:
        id - primitive id of the intersected object
        u - u surface paramater of the intersection point
        v - v surface parameter of the intersection point
      • setIntersection

        public final void setIntersection​(int id,
                                          float u,
                                          float v,
                                          float w)
        Record an intersection with the specified primitive id. The parent object is assumed to be the current instance. The u and v parameters are used to pinpoint the location on the surface if needed.
        Parameters:
        id - primitive id of the intersected object
        u - u surface paramater of the intersection point
        v - v surface parameter of the intersection point