Class: Ray

Ray

Ray constructor

new Ray(origin, dir)

Parameters:
Name Type Description
origin
dir

Methods


<static> createFromPixel(renderContext, x, y)

Create a ray from a pixel
Parameters:
Name Type Description
renderContext
x
y
Returns:
Ray
Type
Ray

<static> createFromEvent(renderContext, event)

Create a ray from an event
Parameters:
Name Type Description
renderContext
event
Returns:
Ray
Type
Ray

<static> Intersection(t)

Intersection object returned
Parameters:
Name Type Description
t

computePoint(t)

Compute a point on the ray given its t parameter
Parameters:
Name Type Description
t
Returns:
Point

planeIntersect(pt, normal)

Compute intersection between a plan and ray
Parameters:
Name Type Description
pt
normal
Returns:
The nearest intersection, < 0 if no intersection

sphereIntersect(center, radius)

Compute intersection between a sphere and ray
Parameters:
Name Type Description
center
radius
Returns:
the nearest intersection, < 0 if no intersection

triangleIntersectOptimized(verts, i0, i1, i2)

Ray triangle intersection optimized
Parameters:
Name Type Description
verts
i0
i1
i2
Returns:
the nearest intersection, null if no intersection

nodeIntersect(node, intersects)

Parameters:
Name Type Description
node
intersects
Returns:
Intersects

lodNodeIntersect(node, intersects)

Parameters:
Name Type Description
node
intersects
Returns:
Intersects

geometryIntersect(geometry, intersects)

Parameters:
Name Type Description
geometry
intersects
Returns:
Intersects