You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
imbcmdth edited this page Sep 14, 2010
·
1 revision
jsBVH.insert ( options )
Options:
intervals1 : required : An array. Each entry is a pair of numbers representing the interval along a single dimension in the tree. object : required : Any object to add to the tree. comparators : options : An object. Defaults to { overlap_intervals: jsBVH.Interval.overlap_intervals, contains_intervals: jsBVH.Interval.contains_intervals } . Use this to override the default comparators to implement different search geometries. Default geometries is an n-dimensional “cube”.
Returns:
Nothing.
Usage:
Insert a 10×15 object that starts at position 12×23 into a 2-dimensional BVH: myBVH.insert( { intervals: [{a:12, b:10}, {a:23, b:15}], object: myObject } );
Notes
1Intervals are any array with length equal to the number of dimensions that contains object literals with two values {a, b}. The object itself is not saved or used directly but a copy is made.
Examples:
1-D: Intervals = [{a,b}];
2-D: Intervals = [{a,b},{a,b}];
3-D: Intervals = [{a,b},{a,b},{a,b}];