Hi
I notised the getClassName() checks in gizmo code in 4.2.0-Alpha fails on bjs propriatary mesh class, “GroundMesh” from BABYLON.MeshBuilder.CreateGround().
(Note, GroundMesh is visually transformed by the gizmo, but matrix is never updated,
e.g. mesh.position will continue to return 0,0,0).
if (inheritsTargetCamera) {
var targetCamera = this._attachedNode as TargetCamera;
targetCamera.rotation = this._tempQuaternion.toEulerAngles();
if (targetCamera.rotationQuaternion) {
targetCamera.rotationQuaternion.copyFrom(this._tempQuaternion);
}
}
camera.position.copyFrom(this._tempVector);
} else if (this._attachedNode.getClassName() === "Mesh" || this._attachedNode.getClassName() === "AbstractMesh" || this._attachedNode.getClassName() === "TransformNode") {
var transform = this._attachedNode as TransformNode;
if (transform.parent) {
var parentInv = new Matrix();
var localMat = new Matrix();
transform.parent.getWorldMatrix().invertToRef(parentInv);
this._attachedNode._worldMatrix.multiplyToRef(parentInv, localMat);
localMat.decompose(transform.scaling, this._tempQuaternion, transform.position);
} else {
this._attachedNode._worldMatrix.decompose(transform.scaling, this._tempQuaternion, transform.position);
}
Cedric
August 3, 2020, 11:43am
3
Indeed! That’s for me. Taking a look…
Cedric
August 3, 2020, 12:21pm
4
2 Likes