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 {
130
130
*/
131
131
this . layers = new Layers ( ) ;
132
132
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
+
133
150
// private
134
151
135
152
this . subTrees = [ ] ;
@@ -231,7 +248,7 @@ class Octree {
231
248
232
249
const len = subTrees [ i ] . triangles . length ;
233
250
234
- if ( len > 8 && level < 16 ) {
251
+ if ( len > this . trianglesPerLeaf && level < this . maxLevel ) {
235
252
236
253
subTrees [ i ] . split ( level + 1 ) ;
237
254
You can’t perform that action at this time.
0 commit comments