|
@@ -206,7 +206,17 @@ THREE.TransformControls = function ( camera, domElement ) {
|
|
|
if ( this.object !== undefined ) {
|
|
|
|
|
|
this.object.updateMatrixWorld();
|
|
|
- this.object.parent.matrixWorld.decompose( parentPosition, parentQuaternion, parentScale );
|
|
|
+
|
|
|
+ if ( this.object.parent === null ) {
|
|
|
+
|
|
|
+ console.error( 'TransformControls: The attached 3D object must be a part of the scene graph.' );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.object.parent.matrixWorld.decompose( parentPosition, parentQuaternion, parentScale );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
this.object.matrixWorld.decompose( worldPosition, worldQuaternion, worldScale );
|
|
|
|
|
|
parentQuaternionInv.copy( parentQuaternion ).inverse();
|