|
@@ -7094,6 +7094,9 @@ const _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );
|
|
|
const _addedEvent = { type: 'added' };
|
|
|
const _removedEvent = { type: 'removed' };
|
|
|
|
|
|
+const _childaddedEvent = { type: 'childadded', child: null };
|
|
|
+const _childremovedEvent = { type: 'childremoved', child: null };
|
|
|
+
|
|
|
class Object3D extends EventDispatcher {
|
|
|
|
|
|
constructor() {
|
|
@@ -7410,6 +7413,10 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
object.dispatchEvent( _addedEvent );
|
|
|
|
|
|
+ _childaddedEvent.child = object;
|
|
|
+ this.dispatchEvent( _childaddedEvent );
|
|
|
+ _childaddedEvent.child = null;
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
|
|
@@ -7443,6 +7450,10 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
object.dispatchEvent( _removedEvent );
|
|
|
|
|
|
+ _childremovedEvent.child = object;
|
|
|
+ this.dispatchEvent( _childremovedEvent );
|
|
|
+ _childremovedEvent.child = null;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return this;
|
|
@@ -51754,7 +51765,6 @@ class SpotLightHelper extends Object3D {
|
|
|
|
|
|
this.light = light;
|
|
|
|
|
|
- this.matrix = light.matrixWorld;
|
|
|
this.matrixAutoUpdate = false;
|
|
|
|
|
|
this.color = color;
|
|
@@ -51806,6 +51816,24 @@ class SpotLightHelper extends Object3D {
|
|
|
this.light.updateWorldMatrix( true, false );
|
|
|
this.light.target.updateWorldMatrix( true, false );
|
|
|
|
|
|
+ // update the local matrix based on the parent and light target transforms
|
|
|
+ if ( this.parent ) {
|
|
|
+
|
|
|
+ this.parent.updateWorldMatrix( true );
|
|
|
+
|
|
|
+ this.matrix
|
|
|
+ .copy( this.parent.matrixWorld )
|
|
|
+ .invert()
|
|
|
+ .multiply( this.light.matrixWorld );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.matrix.copy( this.light.matrixWorld );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.matrixWorld.copy( this.light.matrixWorld );
|
|
|
+
|
|
|
const coneLength = this.light.distance ? this.light.distance : 1000;
|
|
|
const coneWidth = coneLength * Math.tan( this.light.angle );
|
|
|
|