@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.
@@ -1,14 +1,16 @@
1
- import { Scene, StaticSound, TransformNode, Vector3 } from '@babylonjs/core';
1
+ import { Quaternion, Scene, StaticSound, TransformNode, Vector3 } from '@babylonjs/core';
2
2
  import { LevelConfig, LevelContext } from "../interfaces/level.d.ts";
3
3
  import { GameEntity } from "./entity.d.ts";
4
4
  import { Level } from "./level.d.ts";
5
5
  /**
6
- * Metadata collected from a spawn point node
6
+ * Metadata collected from a spawn point node.
7
+ * Transforms are normalized to canonical Babylon space — the source level's __root__
8
+ * conversion is removed so these values are clean for any entity type.
7
9
  */
8
10
  interface SpawnPointData {
9
11
  name: string;
10
12
  position: Vector3;
11
- rotation: Vector3;
13
+ rotation: Quaternion;
12
14
  scaling: Vector3;
13
15
  node: TransformNode;
14
16
  }
@@ -101,7 +103,6 @@ export declare class GameLevel extends Level {
101
103
  * and fix PBR material falloff for compatibility.
102
104
  */
103
105
  private _setupClustering;
104
- private _toVector3;
105
106
  private _toColor3;
106
107
  /**
107
108
  * Configure and enable the Havok physics plugin with the level's gravity settings.
@@ -122,6 +123,10 @@ export declare class GameLevel extends Level {
122
123
  * Check a node's metadata for spawn/entity markers and run any registered property handlers.
123
124
  */
124
125
  private _processNodeMetadata;
126
+ /**
127
+ * Run registered property handlers on a node.
128
+ */
129
+ private _runPropertyHandlers;
125
130
  /**
126
131
  * Match collected spawn points against the level config's spawn definitions and instantiate entities.
127
132
  */
@@ -134,10 +139,6 @@ export declare class GameLevel extends Level {
134
139
  * Create an entity from a spawn definition, inheriting position/rotation/scaling from the spawn point.
135
140
  */
136
141
  private _spawnEntity;
137
- /**
138
- * Converts a Vector3 to a plain `{ x, y, z }` object for serialization into entity state.
139
- */
140
- private _vectorToObject;
141
142
  /**
142
143
  * Build or import a mesh from the entity definition and attach it to the entity.
143
144
  * Supports primitive shapes (box/sphere/capsule/cylinder) and GLB/GLTF file paths.
@@ -125,6 +125,15 @@ export interface Vec3Config {
125
125
  y: number;
126
126
  z: number;
127
127
  }
128
+ /**
129
+ * Reusable quaternion config for rotations.
130
+ */
131
+ export interface QuatConfig {
132
+ x: number;
133
+ y: number;
134
+ z: number;
135
+ w: number;
136
+ }
128
137
  /**
129
138
  * Reusable RGB color config.
130
139
  */
package/dist/sage.d.ts CHANGED
@@ -45,3 +45,4 @@ export { generateId } from "./utils/id.d.ts";
45
45
  export { RaycastHelper } from "./utils/raycast.d.ts";
46
46
  export type { EntityPickResult, EntityPickFilter } from "./utils/raycast.d.ts";
47
47
  export { StateMachine } from "./utils/stateMachine.d.ts";
48
+ export { getCanonicalTransform, toQuatObject, toQuaternion, toVec3Object, toVector3, } from "./utils/vectors.d.ts";