@babylonjs/core 6.6.0 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Behaviors/behavior.d.ts +1 -1
- package/Behaviors/behavior.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -0
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/gizmo.d.ts +21 -0
- package/Gizmos/gizmo.js +30 -3
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/positionGizmo.d.ts +3 -1
- package/Gizmos/positionGizmo.js +9 -0
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.d.ts +3 -1
- package/Gizmos/rotationGizmo.js +9 -0
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.d.ts +3 -1
- package/Gizmos/scaleGizmo.js +11 -0
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Maths/math.vector.d.ts +5 -0
- package/Maths/math.vector.js +7 -0
- package/Maths/math.vector.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +25 -24
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +1 -1
- package/Physics/v2/physicsBody.js +5 -1
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAnisotropic.js +3 -3
- package/Shaders/ShadersInclude/pbrBlockAnisotropic.js.map +1 -1
- package/ShadersWGSL/postprocess.vertex.d.ts +5 -0
- package/ShadersWGSL/postprocess.vertex.js +12 -0
- package/ShadersWGSL/postprocess.vertex.js.map +1 -0
- package/assetContainer.js +5 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,13 +19,6 @@ class MeshAccumulator {
|
|
|
19
19
|
constructor(mesh, collectIndices, scene) {
|
|
20
20
|
this._vertices = []; /// Vertices in body space
|
|
21
21
|
this._indices = [];
|
|
22
|
-
const worldFromRoot = mesh.computeWorldMatrix(true);
|
|
23
|
-
const rootScale = new Vector3();
|
|
24
|
-
const rootOrientation = new Quaternion();
|
|
25
|
-
const rootTranslation = new Vector3();
|
|
26
|
-
worldFromRoot.decompose(rootScale, rootOrientation, rootTranslation);
|
|
27
|
-
this._bodyFromWorld = Matrix.Compose(Vector3.One(), mesh.rotationQuaternion ? mesh.rotationQuaternion : Quaternion.Identity(), mesh.position);
|
|
28
|
-
this._bodyFromWorld = this._bodyFromWorld.invert();
|
|
29
22
|
this._isRightHanded = scene.useRightHandedSystem;
|
|
30
23
|
this._collectIndices = collectIndices;
|
|
31
24
|
}
|
|
@@ -44,8 +37,10 @@ class MeshAccumulator {
|
|
|
44
37
|
*/
|
|
45
38
|
addMesh(mesh, includeChildren) {
|
|
46
39
|
const indexOffset = this._vertices.length;
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
// Force absoluteScaling to be computed
|
|
41
|
+
mesh.computeWorldMatrix(true);
|
|
42
|
+
const shapeFromBody = TmpVectors.Matrix[0];
|
|
43
|
+
Matrix.ScalingToRef(mesh.absoluteScaling.x, mesh.absoluteScaling.y, mesh.absoluteScaling.z, shapeFromBody);
|
|
49
44
|
const vertexData = mesh.getVerticesData(VertexBuffer.PositionKind) || [];
|
|
50
45
|
const numVerts = vertexData.length / 3;
|
|
51
46
|
for (let v = 0; v < numVerts; v++) {
|
|
@@ -422,6 +417,7 @@ export class HavokPlugin {
|
|
|
422
417
|
* physical behavior of the body.
|
|
423
418
|
*/
|
|
424
419
|
syncTransform(body, transformNode) {
|
|
420
|
+
var _a;
|
|
425
421
|
if (body._pluginDataInstances.length) {
|
|
426
422
|
// instances
|
|
427
423
|
const m = transformNode;
|
|
@@ -453,23 +449,28 @@ export class HavokPlugin {
|
|
|
453
449
|
quat.set(bodyOrientation[0], bodyOrientation[1], bodyOrientation[2], bodyOrientation[3]);
|
|
454
450
|
const parent = transformNode.parent;
|
|
455
451
|
// transform position/orientation in parent space
|
|
456
|
-
if (parent && parent.
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
452
|
+
if (parent && !parent.getWorldMatrix().isIdentity()) {
|
|
453
|
+
parent.computeWorldMatrix(true);
|
|
454
|
+
quat.normalize();
|
|
455
|
+
const finalTransform = TmpVectors.Matrix[0];
|
|
456
|
+
const finalTranslation = TmpVectors.Vector3[0];
|
|
457
|
+
finalTranslation.copyFromFloats(bodyTranslation[0], bodyTranslation[1], bodyTranslation[2]);
|
|
458
|
+
Matrix.ComposeToRef(transformNode.absoluteScaling, quat, finalTranslation, finalTransform);
|
|
459
|
+
const parentInverseTransform = TmpVectors.Matrix[1];
|
|
460
|
+
parent.getWorldMatrix().invertToRef(parentInverseTransform);
|
|
461
|
+
const localTransform = TmpVectors.Matrix[2];
|
|
462
|
+
finalTransform.multiplyToRef(parentInverseTransform, localTransform);
|
|
463
|
+
localTransform.decomposeToTransformNode(transformNode);
|
|
464
|
+
(_a = transformNode.rotationQuaternion) === null || _a === void 0 ? void 0 : _a.normalize();
|
|
464
465
|
}
|
|
465
466
|
else {
|
|
466
467
|
transformNode.position.set(bodyTranslation[0], bodyTranslation[1], bodyTranslation[2]);
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
468
|
+
if (transformNode.rotationQuaternion) {
|
|
469
|
+
transformNode.rotationQuaternion.copyFrom(quat);
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
quat.toEulerAnglesToRef(transformNode.rotation);
|
|
473
|
+
}
|
|
473
474
|
}
|
|
474
475
|
}
|
|
475
476
|
catch (e) {
|
|
@@ -1032,7 +1033,7 @@ export class HavokPlugin {
|
|
|
1032
1033
|
*/
|
|
1033
1034
|
_getTransformInfos(node) {
|
|
1034
1035
|
if (node.parent) {
|
|
1035
|
-
node.computeWorldMatrix();
|
|
1036
|
+
node.computeWorldMatrix(true);
|
|
1036
1037
|
return [this._bVecToV3(node.absolutePosition), this._bQuatToV4(node.absoluteRotationQuaternion)];
|
|
1037
1038
|
}
|
|
1038
1039
|
let orientation = TmpVectors.Quaternion[0];
|