-
Notifications
You must be signed in to change notification settings - Fork 3
jsBVH.intersect()
jsBVH.intersect ( options )
ray1 : required : An array. Each entry is a pair of numbers representing start(a) and direction(b) of the ray along a single dimension in the tree.
return_nodes : optional : A boolean. Defaults to false. Set to true to return an array of leaf nodes instead of an array of the objects contained within the leaf nodes.
return_array : optional : An array. Defaults to an empty array. The search function will append any objects found to this array.
An array of objects that intersect ray.
Search along a horizontal ray that starts at position -1×10 in a 2-dimensional BVH:
var myObjects = myBVHrsect( { ray: [{a:-1, b:1}, {a:10, b:0}] });
1 Ray is an array with length equal to the number of dimensions that contains object literals with two values {a, b}. {a:} is the ray’s origin along a dimension and {b:} is its the direction.
Examples:
1-D:
Ray= [{a,b}];
2-D:
Ray= [{a,b},{a,b}];
3-D:
Ray= [{a,b},{a,b},{a,b}];