Browse Source

Updated builds.

Mugen87 1 year ago
parent
commit
a99977619f
3 changed files with 58 additions and 2 deletions
  1. 29 1
      build/three.cjs
  2. 29 1
      build/three.module.js
  3. 0 0
      build/three.module.min.js

+ 29 - 1
build/three.cjs

@@ -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 );
 

+ 29 - 1
build/three.module.js

@@ -7092,6 +7092,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() {
@@ -7408,6 +7411,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 );
@@ -7441,6 +7448,10 @@ class Object3D extends EventDispatcher {
 
 			object.dispatchEvent( _removedEvent );
 
+			_childremovedEvent.child = object;
+			this.dispatchEvent( _childremovedEvent );
+			_childremovedEvent.child = null;
+
 		}
 
 		return this;
@@ -51752,7 +51763,6 @@ class SpotLightHelper extends Object3D {
 
 		this.light = light;
 
-		this.matrix = light.matrixWorld;
 		this.matrixAutoUpdate = false;
 
 		this.color = color;
@@ -51804,6 +51814,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 );
 

File diff suppressed because it is too large
+ 0 - 0
build/three.module.min.js


Some files were not shown because too many files changed in this diff