@@ -172,7 +172,7 @@ class Node{
172
172
this . updateAreaText ( sceneManager . currentUnit ) ;
173
173
174
174
// Update visibility
175
- this . changeFrustumVisibility ( this . areaAppear ) ;
175
+ this . changeVisibility ( this . areaAppear ) ;
176
176
}
177
177
178
178
updateTransformation ( )
@@ -204,12 +204,12 @@ class Node{
204
204
scene . add ( this . nameText ) ;
205
205
scene . add ( this . areaValueText ) ;
206
206
this . areaAppear = true ;
207
- this . changeFrustumVisibility ( true ) ;
207
+ this . changeVisibility ( true ) ;
208
208
}
209
209
210
210
removeFromScene ( scene )
211
211
{
212
- this . changeFrustumVisibility ( false ) ;
212
+ this . changeVisibility ( false ) ;
213
213
this . areaAppear = false ;
214
214
scene . remove ( this . cameraPerspective ) ;
215
215
scene . remove ( this . cameraPerspectiveHelper ) ;
@@ -228,9 +228,14 @@ class Node{
228
228
this . areaAppear = visible ;
229
229
if ( this . cameraPerspective ) this . cameraPerspective . visible = visible ;
230
230
if ( this . cameraPerspectiveHelper ) this . cameraPerspectiveHelper . visible = visible ;
231
- if ( this . mesh ) this . mesh . visible = visible ;
232
231
if ( this . nameText ) this . nameText . visible = visible ;
233
232
if ( this . areaValueText ) this . areaValueText . visible = visible && ( this . coveredPointsAbove && this . coveredPointsAbove . length > 2 ) ;
233
+ }
234
+
235
+ changeVisibility ( visible = ! this . areaAppear )
236
+ {
237
+ this . changeFrustumVisibility ( visible ) ;
238
+ if ( this . mesh ) this . mesh . visible = visible ;
234
239
235
240
if ( this . uiElement && typeof this . uiElement . changeVisibilityUIOnly === 'function' ) {
236
241
this . uiElement . changeVisibilityUIOnly ( visible ) ;
0 commit comments