|
@@ -1175,17 +1175,17 @@ export class TransformNode extends Node {
|
|
public resetLocalMatrix(independentOfChildren : boolean = true): void
|
|
public resetLocalMatrix(independentOfChildren : boolean = true): void
|
|
{
|
|
{
|
|
this.computeWorldMatrix();
|
|
this.computeWorldMatrix();
|
|
- if (independentOfChildren){
|
|
|
|
|
|
+ if (independentOfChildren) {
|
|
let children = this.getChildren();
|
|
let children = this.getChildren();
|
|
for(let i = 0; i < children.length; ++i){
|
|
for(let i = 0; i < children.length; ++i){
|
|
let child = children[i] as TransformNode;
|
|
let child = children[i] as TransformNode;
|
|
- if (child){
|
|
|
|
|
|
+ if (child) {
|
|
child.computeWorldMatrix();
|
|
child.computeWorldMatrix();
|
|
let bakedMatrix = TmpVectors.Matrix[0];
|
|
let bakedMatrix = TmpVectors.Matrix[0];
|
|
child._localMatrix.multiplyToRef(this._localMatrix, bakedMatrix);
|
|
child._localMatrix.multiplyToRef(this._localMatrix, bakedMatrix);
|
|
let tmpRotationQuaternion = TmpVectors.Quaternion[0];
|
|
let tmpRotationQuaternion = TmpVectors.Quaternion[0];
|
|
bakedMatrix.decompose(child.scaling, tmpRotationQuaternion, child.position);
|
|
bakedMatrix.decompose(child.scaling, tmpRotationQuaternion, child.position);
|
|
- if (child.rotationQuaternion){
|
|
|
|
|
|
+ if (child.rotationQuaternion) {
|
|
child.rotationQuaternion = tmpRotationQuaternion;
|
|
child.rotationQuaternion = tmpRotationQuaternion;
|
|
} else {
|
|
} else {
|
|
tmpRotationQuaternion.toEulerAnglesToRef(child.rotation);
|
|
tmpRotationQuaternion.toEulerAnglesToRef(child.rotation);
|