Package org.sunflow.core
Class IntersectionState
- java.lang.Object
-
- org.sunflow.core.IntersectionState
-
public final class IntersectionState extends java.lang.ObjectThis class is used to store ray/object intersections. It also provides additional data to assistAccelerationStructureobjects with traversal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntersectionState.StackNodeTraversal stack node, helps with tree-basedAccelerationStructuretraversal.
-
Constructor Summary
Constructors Constructor Description IntersectionState()Initializes all traversal stacks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntersectionState.StackNode[]getStack()Get stack object for tree basedAccelerationStructures.floatgetTime()Returns the time at which the intersection should be calculated.booleanhit()Checks to see if a hit has been recorded.voidsetIntersection(int id)Record an intersection with the specified primitive id.voidsetIntersection(int id, float u, float v)Record an intersection with the specified primitive id.voidsetIntersection(int id, float u, float v, float w)Record an intersection with the specified primitive id.
-
-
-
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
-
getStack
public final IntersectionState.StackNode[] getStack()
Get stack object for tree basedAccelerationStructures.- Returns:
- array of stack nodes
-
hit
public final boolean hit()
Checks to see if a hit has been recorded.- Returns:
trueif a hit has been recorded,falseotherwise
-
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 objectu- u surface paramater of the intersection pointv- 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 objectu- u surface paramater of the intersection pointv- v surface parameter of the intersection point
-
-