@@ -98,57 +98,6 @@ export class DebugTilesPlugin {
98
98
99
99
}
100
100
101
- constructor ( options ) {
102
-
103
- options = {
104
- displayParentBounds : false ,
105
- displayBoxBounds : false ,
106
- displaySphereBounds : false ,
107
- displayRegionBounds : false ,
108
- colorMode : NONE ,
109
- maxDebugDepth : - 1 ,
110
- maxDebugDistance : - 1 ,
111
- maxDebugError : - 1 ,
112
- customColorCallback : null ,
113
- unlit : false ,
114
- enabled : true ,
115
- ...options ,
116
- } ;
117
-
118
- this . name = 'DEBUG_TILES_PLUGIN' ;
119
- this . tiles = null ;
120
-
121
- this . _colorMode = null ;
122
- this . _unlit = null ;
123
- this . materialsNeedUpdate = false ;
124
-
125
- this . extremeDebugDepth = - 1 ;
126
- this . extremeDebugError = - 1 ;
127
- this . boxGroup = null ;
128
- this . sphereGroup = null ;
129
- this . regionGroup = null ;
130
-
131
- // options
132
- this . _enabled = options . enabled ;
133
- this . _displayParentBounds = options . displayParentBounds ;
134
- this . displayBoxBounds = options . displayBoxBounds ;
135
- this . displaySphereBounds = options . displaySphereBounds ;
136
- this . displayRegionBounds = options . displayRegionBounds ;
137
- this . colorMode = options . colorMode ;
138
- this . maxDebugDepth = options . maxDebugDepth ;
139
- this . maxDebugDistance = options . maxDebugDistance ;
140
- this . maxDebugError = options . maxDebugError ;
141
- this . customColorCallback = options . customColorCallback ;
142
- this . unlit = options . unlit ;
143
-
144
- this . getDebugColor = ( value , target ) => {
145
-
146
- target . setRGB ( value , value , value ) ;
147
-
148
- } ;
149
-
150
- }
151
-
152
101
get enabled ( ) {
153
102
154
103
return this . _enabled ;
@@ -216,16 +165,61 @@ export class DebugTilesPlugin {
216
165
217
166
}
218
167
219
- // initialize the groups for displaying helpers, register events, and initialize existing tiles
220
- init ( tiles ) {
168
+ constructor ( options ) {
221
169
222
- this . tiles = tiles ;
170
+ options = {
171
+ displayParentBounds : false ,
172
+ displayBoxBounds : false ,
173
+ displaySphereBounds : false ,
174
+ displayRegionBounds : false ,
175
+ colorMode : NONE ,
176
+ maxDebugDepth : - 1 ,
177
+ maxDebugDistance : - 1 ,
178
+ maxDebugError : - 1 ,
179
+ customColorCallback : null ,
180
+ unlit : false ,
181
+ enabled : true ,
182
+ ...options ,
183
+ } ;
184
+
185
+ this . name = 'DEBUG_TILES_PLUGIN' ;
186
+ this . tiles = null ;
223
187
224
- if ( ! this . enabled ) {
188
+ this . _colorMode = null ;
189
+ this . _unlit = null ;
190
+ this . materialsNeedUpdate = false ;
225
191
226
- return ;
192
+ this . extremeDebugDepth = - 1 ;
193
+ this . extremeDebugError = - 1 ;
194
+ this . boxGroup = null ;
195
+ this . sphereGroup = null ;
196
+ this . regionGroup = null ;
227
197
228
- }
198
+ // options
199
+ this . _enabled = options . enabled ;
200
+ this . _displayParentBounds = options . displayParentBounds ;
201
+ this . displayBoxBounds = options . displayBoxBounds ;
202
+ this . displaySphereBounds = options . displaySphereBounds ;
203
+ this . displayRegionBounds = options . displayRegionBounds ;
204
+ this . colorMode = options . colorMode ;
205
+ this . maxDebugDepth = options . maxDebugDepth ;
206
+ this . maxDebugDistance = options . maxDebugDistance ;
207
+ this . maxDebugError = options . maxDebugError ;
208
+ this . customColorCallback = options . customColorCallback ;
209
+ this . unlit = options . unlit ;
210
+
211
+ this . getDebugColor = ( value , target ) => {
212
+
213
+ target . setRGB ( value , value , value ) ;
214
+
215
+ } ;
216
+
217
+ }
218
+
219
+ // initialize the groups for displaying helpers, register events, and initialize existing tiles
220
+ init ( tiles ) {
221
+
222
+ this . tiles = tiles ;
229
223
230
224
// initialize groups
231
225
const tilesGroup = tiles . group ;
@@ -926,12 +920,6 @@ export class DebugTilesPlugin {
926
920
927
921
dispose ( ) {
928
922
929
- if ( ! this . enabled ) {
930
-
931
- return ;
932
-
933
- }
934
-
935
923
const tiles = this . tiles ;
936
924
937
925
tiles . removeEventListener ( 'load-tile-set' , this . _onLoadTileSetCB ) ;
0 commit comments