|
@@ -145,6 +145,8 @@ export class TransformNode extends Node {
|
|
|
|
|
|
private _usePivotMatrix = false;
|
|
private _usePivotMatrix = false;
|
|
private _absolutePosition = Vector3.Zero();
|
|
private _absolutePosition = Vector3.Zero();
|
|
|
|
+ private _absoluteScaling = Vector3.Zero();
|
|
|
|
+ private _absoluteRotationQuaternion = Quaternion.Identity();
|
|
private _pivotMatrix = Matrix.Identity();
|
|
private _pivotMatrix = Matrix.Identity();
|
|
private _pivotMatrixInverse: Matrix;
|
|
private _pivotMatrixInverse: Matrix;
|
|
protected _postMultiplyPivotMatrix = false;
|
|
protected _postMultiplyPivotMatrix = false;
|
|
@@ -354,6 +356,22 @@ export class TransformNode extends Node {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * Returns the current mesh absolute scaling.
|
|
|
|
+ * Returns a Vector3.
|
|
|
|
+ */
|
|
|
|
+ public get absoluteScaling(): Vector3 {
|
|
|
|
+ return this._absoluteScaling;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Returns the current mesh absolute scaling.
|
|
|
|
+ * Returns a Vector3.
|
|
|
|
+ */
|
|
|
|
+ public get absoluteRotationQuaternion(): Quaternion {
|
|
|
|
+ return this._absoluteRotationQuaternion;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Sets a new matrix to apply before all other transformation
|
|
* Sets a new matrix to apply before all other transformation
|
|
* @param matrix defines the transform matrix
|
|
* @param matrix defines the transform matrix
|
|
* @returns the current TransformNode
|
|
* @returns the current TransformNode
|
|
@@ -1078,8 +1096,8 @@ export class TransformNode extends Node {
|
|
|
|
|
|
this._afterComputeWorldMatrix();
|
|
this._afterComputeWorldMatrix();
|
|
|
|
|
|
- // Absolute position
|
|
|
|
- this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]);
|
|
|
|
|
|
+ // Update absolute transform values
|
|
|
|
+ this._worldMatrix.decompose(this._absoluteScaling, this._absoluteRotationQuaternion, this._absolutePosition);
|
|
|
|
|
|
// Callbacks
|
|
// Callbacks
|
|
this.onAfterWorldMatrixUpdateObservable.notifyObservers(this);
|
|
this.onAfterWorldMatrixUpdateObservable.notifyObservers(this);
|