|
@@ -96325,6 +96325,7 @@ var TransformNode = /** @class */ (function (_super) {
|
|
_this._pivotMatrix = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].Identity();
|
|
_this._pivotMatrix = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].Identity();
|
|
_this._postMultiplyPivotMatrix = false;
|
|
_this._postMultiplyPivotMatrix = false;
|
|
_this._tempMatrix = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].Identity();
|
|
_this._tempMatrix = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].Identity();
|
|
|
|
+ _this._tempMatrix2 = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].Identity();
|
|
_this._isWorldMatrixFrozen = false;
|
|
_this._isWorldMatrixFrozen = false;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
_this._indexInSceneTransformNodesArray = -1;
|
|
_this._indexInSceneTransformNodesArray = -1;
|
|
@@ -97068,10 +97069,10 @@ var TransformNode = /** @class */ (function (_super) {
|
|
if (this.infiniteDistance && !this.parent && camera) {
|
|
if (this.infiniteDistance && !this.parent && camera) {
|
|
var cameraWorldMatrix = camera.getWorldMatrix();
|
|
var cameraWorldMatrix = camera.getWorldMatrix();
|
|
var cameraGlobalPosition = new _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Vector3"](cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]);
|
|
var cameraGlobalPosition = new _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Vector3"](cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]);
|
|
- _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].TranslationToRef(this.position.x + cameraGlobalPosition.x, this.position.y + cameraGlobalPosition.y, this.position.z + cameraGlobalPosition.z, _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[2]);
|
|
|
|
|
|
+ _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].TranslationToRef(this.position.x + cameraGlobalPosition.x, this.position.y + cameraGlobalPosition.y, this.position.z + cameraGlobalPosition.z, this._tempMatrix2);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].TranslationToRef(this.position.x, this.position.y, this.position.z, _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[2]);
|
|
|
|
|
|
+ _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].TranslationToRef(this.position.x, this.position.y, this.position.z, this._tempMatrix2);
|
|
}
|
|
}
|
|
// Composing transformations
|
|
// Composing transformations
|
|
this._pivotMatrix.multiplyToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1], _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[4]);
|
|
this._pivotMatrix.multiplyToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1], _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[4]);
|
|
@@ -97111,29 +97112,30 @@ var TransformNode = /** @class */ (function (_super) {
|
|
_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1].setTranslationFromFloats(0, 0, 0);
|
|
_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1].setTranslationFromFloats(0, 0, 0);
|
|
_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1].invertToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[0]);
|
|
_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1].invertToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[0]);
|
|
}
|
|
}
|
|
- _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1].copyFrom(this._tempMatrix);
|
|
|
|
- _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[1].multiplyToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[0], this._tempMatrix);
|
|
|
|
|
|
+ this._tempMatrix.multiplyToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[0], this._tempMatrix);
|
|
}
|
|
}
|
|
// Post multiply inverse of pivotMatrix
|
|
// Post multiply inverse of pivotMatrix
|
|
if (this._postMultiplyPivotMatrix) {
|
|
if (this._postMultiplyPivotMatrix) {
|
|
this._tempMatrix.multiplyToRef(this._pivotMatrixInverse, this._tempMatrix);
|
|
this._tempMatrix.multiplyToRef(this._pivotMatrixInverse, this._tempMatrix);
|
|
}
|
|
}
|
|
// Local world
|
|
// Local world
|
|
- this._tempMatrix.multiplyToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[2], this._localMatrix);
|
|
|
|
|
|
+ this._tempMatrix.multiplyToRef(this._tempMatrix2, this._localMatrix);
|
|
// Parent
|
|
// Parent
|
|
if (this.parent && this.parent.getWorldMatrix) {
|
|
if (this.parent && this.parent.getWorldMatrix) {
|
|
if (this.billboardMode !== TransformNode.BILLBOARDMODE_NONE) {
|
|
if (this.billboardMode !== TransformNode.BILLBOARDMODE_NONE) {
|
|
if (this._transformToBoneReferal) {
|
|
if (this._transformToBoneReferal) {
|
|
- this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[6]);
|
|
|
|
- _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7].copyFrom(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[6]);
|
|
|
|
|
|
+ this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7]);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7].copyFrom(this.parent.getWorldMatrix());
|
|
_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7].copyFrom(this.parent.getWorldMatrix());
|
|
}
|
|
}
|
|
- this._localMatrix.getTranslationToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Vector3[5]);
|
|
|
|
- _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Vector3"].TransformCoordinatesToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Vector3[5], _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7], _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Vector3[5]);
|
|
|
|
- this._worldMatrix.copyFrom(this._localMatrix);
|
|
|
|
- this._worldMatrix.setTranslation(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Vector3[5]);
|
|
|
|
|
|
+ // Extract scaling and translation from parent
|
|
|
|
+ var translation = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Vector3[5];
|
|
|
|
+ var scale = _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Vector3[6];
|
|
|
|
+ _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7].decompose(scale, undefined, translation);
|
|
|
|
+ _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Matrix"].ScalingToRef(scale.x, scale.y, scale.z, _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7]);
|
|
|
|
+ _Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7].setTranslation(translation);
|
|
|
|
+ this._localMatrix.multiplyToRef(_Maths_math__WEBPACK_IMPORTED_MODULE_3__["Tmp"].Matrix[7], this._worldMatrix);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
if (this._transformToBoneReferal) {
|
|
if (this._transformToBoneReferal) {
|