@@ -92,15 +92,13 @@ XML3D.extend(RenderLight.prototype, {
9292 this . scene . emit ( EVENT_TYPE . LIGHT_STRUCTURE_CHANGED , this , removed ) ;
9393 } ,
9494
95- updateWorldMatrix : function ( ) {
96- if ( this . parent ) {
97- this . parent . getWorldMatrix ( tmp_worldMatrix ) ;
98- var page = this . page ;
99- var offset = this . offset ;
100- XML3D . math . mat4 . multiplyOffset ( page , offset + WORLD_MATRIX_OFFSET , page , offset + LOCAL_MATRIX_OFFSET , tmp_worldMatrix , 0 ) ;
101- // We change position / direction of the light
102- this . lightValueChanged ( ) ;
103- }
95+ updateWorldMatrix : function ( sourceMat4 ) {
96+ var page = this . page ;
97+ var offset = this . offset ;
98+ XML3D . math . mat4 . multiplyOffset ( page , offset + WORLD_MATRIX_OFFSET , page , offset + LOCAL_MATRIX_OFFSET , sourceMat4 , 0 ) ;
99+ // We change position / direction of the light
100+ this . lightValueChanged ( ) ;
101+ this . transformDirty = false ;
104102 } ,
105103
106104 visibilityChanged : function ( newVal ) {
@@ -109,7 +107,8 @@ XML3D.extend(RenderLight.prototype, {
109107 } ,
110108
111109 setTransformDirty : function ( ) {
112- this . updateWorldMatrix ( ) ;
110+ this . parent . getWorldMatrix ( tmp_worldMatrix ) ;
111+ this . updateWorldMatrix ( tmp_worldMatrix ) ;
113112 } ,
114113
115114 remove : function ( ) {
0 commit comments