File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,23 @@ class Octree {
130130 */
131131 this . layers = new Layers ( ) ;
132132
133+ /**
134+ * The number of triangles a leaf can store before it is split.
135+ *
136+ * @type {number }
137+ * @default 8
138+ */
139+ this . trianglesPerLeaf = 8 ;
140+
141+ /**
142+ * The maximum level of the Octree. It defines the maximum
143+ * hierarchical depth of the data structure.
144+ *
145+ * @type {number }
146+ * @default 16
147+ */
148+ this . maxLevel = 16 ;
149+
133150 // private
134151
135152 this . subTrees = [ ] ;
@@ -231,7 +248,7 @@ class Octree {
231248
232249 const len = subTrees [ i ] . triangles . length ;
233250
234- if ( len > 8 && level < 16 ) {
251+ if ( len > this . trianglesPerLeaf && level < this . maxLevel ) {
235252
236253 subTrees [ i ] . split ( level + 1 ) ;
237254
You can’t perform that action at this time.
0 commit comments