@skewedaspect/sage 0.9.0 → 0.9.1

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,4 +1,4 @@
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";
@@ -8,7 +8,7 @@ import { Level } from "./level.d.ts";
8
8
  interface SpawnPointData {
9
9
  name: string;
10
10
  position: Vector3;
11
- rotation: Vector3;
11
+ rotation: Quaternion;
12
12
  scaling: Vector3;
13
13
  node: TransformNode;
14
14
  }
@@ -101,7 +101,6 @@ export declare class GameLevel extends Level {
101
101
  * and fix PBR material falloff for compatibility.
102
102
  */
103
103
  private _setupClustering;
104
- private _toVector3;
105
104
  private _toColor3;
106
105
  /**
107
106
  * Configure and enable the Havok physics plugin with the level's gravity settings.
@@ -122,6 +121,10 @@ export declare class GameLevel extends Level {
122
121
  * Check a node's metadata for spawn/entity markers and run any registered property handlers.
123
122
  */
124
123
  private _processNodeMetadata;
124
+ /**
125
+ * Run registered property handlers on a node.
126
+ */
127
+ private _runPropertyHandlers;
125
128
  /**
126
129
  * Match collected spawn points against the level config's spawn definitions and instantiate entities.
127
130
  */
@@ -134,10 +137,6 @@ export declare class GameLevel extends Level {
134
137
  * Create an entity from a spawn definition, inheriting position/rotation/scaling from the spawn point.
135
138
  */
136
139
  private _spawnEntity;
137
- /**
138
- * Converts a Vector3 to a plain `{ x, y, z }` object for serialization into entity state.
139
- */
140
- private _vectorToObject;
141
140
  /**
142
141
  * Build or import a mesh from the entity definition and attach it to the entity.
143
142
  * 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 { toVec3Object, toVector3, toQuatObject, toQuaternion } from "./utils/vectors.d.ts";