@skewedaspect/sage 0.9.0 → 0.9.2

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.
@@ -0,0 +1,35 @@
1
+ import { Quaternion, TransformNode, Vector3 } from '@babylonjs/core';
2
+ import { QuatConfig, Vec3Config } from "../interfaces/level.d.ts";
3
+ /**
4
+ * Convert a BabylonJS Vector3 to a plain { x, y, z } object.
5
+ */
6
+ export declare function toVec3Object(vector: Vector3): Vec3Config;
7
+ /**
8
+ * Convert a plain { x, y, z } object to a BabylonJS Vector3.
9
+ */
10
+ export declare function toVector3(vec: Vec3Config): Vector3;
11
+ /**
12
+ * Convert a BabylonJS Quaternion to a plain { x, y, z, w } object.
13
+ */
14
+ export declare function toQuatObject(quat: Quaternion): QuatConfig;
15
+ /**
16
+ * Convert a plain { x, y, z, w } object to a BabylonJS Quaternion.
17
+ */
18
+ export declare function toQuaternion(quat: QuatConfig): Quaternion;
19
+ /**
20
+ * Compute a node's transform in canonical Babylon space by rebuilding its world
21
+ * matrix from local transforms, skipping any ancestors whose local matrix has a
22
+ * negative determinant (import conversion nodes like glTF's __root__).
23
+ *
24
+ * This avoids decomposing a mirrored matrix (det < 0), which produces poisoned
25
+ * scaling and rotation. The result is a clean, positive-determinant matrix that
26
+ * works uniformly for primitives and GLB entities.
27
+ *
28
+ * Handles arbitrarily nested import hierarchies (GLB inside GLB) — each
29
+ * conversion node in the chain is individually skipped.
30
+ */
31
+ export declare function getCanonicalTransform(node: TransformNode): {
32
+ position: Vector3;
33
+ rotation: Quaternion;
34
+ scaling: Vector3;
35
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skewedaspect/sage",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "main": "dist/sage.umd.js",
5
5
  "module": "dist/sage.es.js",
6
6
  "types": "dist/sage.d.ts",