@@ -49,9 +49,6 @@ abstract class Block extends Events {
4949 for ( const mesh of this . _environmentMeshes ) {
5050 mesh . matrixAutoUpdate = false ;
5151 }
52-
53- this . updateMatrix ( ) ;
54-
5552 }
5653
5754 /**
@@ -62,6 +59,7 @@ abstract class Block extends Events {
6259
6360 this . handleVerticesChange ( ) ;
6461
62+ // TODO: Separate vertices change and triangles change event?
6563 this . trigger ( 'change:geometry' ) ;
6664 }
6765
@@ -79,6 +77,8 @@ abstract class Block extends Events {
7977 this . _triangleIndices = triangleIndices ;
8078
8179 this . handleTriangleIndicesChange ( ) ;
80+
81+ this . trigger ( 'change:geometry' ) ;
8282 }
8383
8484 /**
@@ -138,7 +138,7 @@ abstract class Block extends Events {
138138 this . updateMatrix ( ) ;
139139 }
140140
141- private updateMatrix ( ) {
141+ protected updateMatrix ( ) {
142142 const scaleMatrix = new THREE . Matrix4 ( ) . makeScale ( this . _scale . x , this . _scale . y , this . _scale . z ) ;
143143 const positionMatrix = new THREE . Matrix4 ( ) . makeTranslation ( this . _position . x , this . _position . y , this . _position . z ) ;
144144
@@ -214,4 +214,6 @@ abstract class Block extends Events {
214214
215215 parent : Block | null = null ;
216216
217+ beforeRenderHook : ( ( renderer : THREE . WebGLRenderer ) => void ) | null = null ;
218+
217219}
0 commit comments