@babylonjs/serializers 9.30.0 → 9.31.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/exportUtils.d.ts +1 -0
- package/exportUtils.js +4 -3
- package/exportUtils.js.map +1 -1
- package/package.json +3 -3
package/exportUtils.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { type Node } from "@babylonjs/core/node.js";
|
|
|
7
7
|
export declare const ConvertHandednessMatrix: Matrix;
|
|
8
8
|
/**
|
|
9
9
|
* Checks if a node is a "noop" transform node, usually inserted by the glTF loader to correct handedness.
|
|
10
|
+
* Refreshes changed transforms even when the scene's render ID has not advanced.
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
13
|
export declare function IsNoopNode(node: Node, useRightHandedSystem: boolean): boolean;
|
package/exportUtils.js
CHANGED
|
@@ -9,6 +9,7 @@ import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
|
|
9
9
|
export const ConvertHandednessMatrix = Matrix.Compose(new Vector3(-1, 1, 1), Quaternion.Identity(), Vector3.Zero());
|
|
10
10
|
/**
|
|
11
11
|
* Checks if a node is a "noop" transform node, usually inserted by the glTF loader to correct handedness.
|
|
12
|
+
* Refreshes changed transforms even when the scene's render ID has not advanced.
|
|
12
13
|
* @internal
|
|
13
14
|
*/
|
|
14
15
|
export function IsNoopNode(node, useRightHandedSystem) {
|
|
@@ -16,14 +17,14 @@ export function IsNoopNode(node, useRightHandedSystem) {
|
|
|
16
17
|
return false;
|
|
17
18
|
}
|
|
18
19
|
// Transform
|
|
20
|
+
const worldMatrix = node.computeWorldMatrix(!node.isSynchronized());
|
|
19
21
|
if (useRightHandedSystem) {
|
|
20
|
-
|
|
21
|
-
if (!matrix.equalsWithEpsilon(Matrix.IdentityReadOnly, Epsilon)) {
|
|
22
|
+
if (!worldMatrix.equalsWithEpsilon(Matrix.IdentityReadOnly, Epsilon)) {
|
|
22
23
|
return false;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
26
|
-
const matrix =
|
|
27
|
+
const matrix = worldMatrix.multiplyToRef(ConvertHandednessMatrix, TmpVectors.Matrix[0]);
|
|
27
28
|
if (!matrix.equalsWithEpsilon(Matrix.IdentityReadOnly, Epsilon)) {
|
|
28
29
|
return false;
|
|
29
30
|
}
|
package/exportUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportUtils.js","sourceRoot":"","sources":["../../../dev/serializers/src/exportUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAEpH
|
|
1
|
+
{"version":3,"file":"exportUtils.js","sourceRoot":"","sources":["../../../dev/serializers/src/exportUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,oBAA6B;IAChE,IAAI,CAAC,CAAC,IAAI,YAAY,aAAa,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,YAAY;IACZ,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IACpE,IAAI,oBAAoB,EAAE,CAAC;QACvB,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAAC;YACnE,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC,uBAAuB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAAC;YAC9D,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,WAAW;IACX,IAAI,IAAI,YAAY,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { Matrix, Quaternion, TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport { Epsilon } from \"core/Maths/math.constants\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { type Node } from \"core/node\";\r\n\r\n/**\r\n * Matrix that converts handedness on the X-axis. Used to convert from LH to RH and vice versa.\r\n * @internal\r\n */\r\nexport const ConvertHandednessMatrix = Matrix.Compose(new Vector3(-1, 1, 1), Quaternion.Identity(), Vector3.Zero());\r\n\r\n/**\r\n * Checks if a node is a \"noop\" transform node, usually inserted by the glTF loader to correct handedness.\r\n * Refreshes changed transforms even when the scene's render ID has not advanced.\r\n * @internal\r\n */\r\nexport function IsNoopNode(node: Node, useRightHandedSystem: boolean): boolean {\r\n if (!(node instanceof TransformNode)) {\r\n return false;\r\n }\r\n\r\n // Transform\r\n const worldMatrix = node.computeWorldMatrix(!node.isSynchronized());\r\n if (useRightHandedSystem) {\r\n if (!worldMatrix.equalsWithEpsilon(Matrix.IdentityReadOnly, Epsilon)) {\r\n return false;\r\n }\r\n } else {\r\n const matrix = worldMatrix.multiplyToRef(ConvertHandednessMatrix, TmpVectors.Matrix[0]);\r\n if (!matrix.equalsWithEpsilon(Matrix.IdentityReadOnly, Epsilon)) {\r\n return false;\r\n }\r\n }\r\n\r\n // Geometry\r\n if (node instanceof AbstractMesh && node.geometry) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/serializers",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.31.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"postcompile": "build-tools -c add-js-to-es6"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@babylonjs/core": "9.
|
|
21
|
+
"@babylonjs/core": "9.31.0",
|
|
22
22
|
"@dev/build-tools": "^1.0.0",
|
|
23
23
|
"@dev/serializers": "^1.0.0",
|
|
24
|
-
"babylonjs-gltf2interface": "9.
|
|
24
|
+
"babylonjs-gltf2interface": "9.31.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@babylonjs/core": "^9.0.0",
|