Browse Source

Ensure .matrixWorld is updated (#25097)

WestLangley 2 years ago
parent
commit
46618d2916
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/core/Object3D.js

+ 4 - 0
src/core/Object3D.js

@@ -247,12 +247,16 @@ class Object3D extends EventDispatcher {
 
 	localToWorld( vector ) {
 
+		this.updateWorldMatrix( true, false );
+
 		return vector.applyMatrix4( this.matrixWorld );
 
 	}
 
 	worldToLocal( vector ) {
 
+		this.updateWorldMatrix( true, false );
+
 		return vector.applyMatrix4( _m1.copy( this.matrixWorld ).invert() );
 
 	}