@zylem/game-lib 0.7.0 → 0.8.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.
- package/README.md +15 -1
- package/dist/actions.d.ts +71 -8
- package/dist/actions.js +1 -1
- package/dist/api/game-lib.api.json +55350 -0
- package/dist/api/game-lib.api.md +4608 -0
- package/dist/api/game-lib.d.ts +8447 -0
- package/dist/api/game-lib.typedoc.json +352456 -0
- package/dist/audio.js +1 -1
- package/dist/{base-node-life-cycle-CnJ-7zX-.d.ts → base-node-life-cycle-BK9xebT9.d.ts} +18 -4
- package/dist/behavior.d.ts +2 -3
- package/dist/behavior.js +1 -1
- package/dist/blueprints-TbGY-h53.d.ts +162 -0
- package/dist/chunk-3PRBSSTS.js +24 -0
- package/dist/chunk-47DG7I7M.js +1 -0
- package/dist/chunk-7GYFZKK7.js +1 -0
- package/dist/chunk-7QF6YTEZ.js +1 -0
- package/dist/chunk-7WRQ2UAN.js +1 -0
- package/dist/chunk-BH53MBAZ.js +1 -0
- package/dist/chunk-BIGH6D34.js +0 -0
- package/dist/chunk-CD7ZOZ35.js +1 -0
- package/dist/chunk-CFVRRRZZ.js +1 -0
- package/dist/chunk-CM5YRNBJ.js +19 -0
- package/dist/chunk-COM6HJ2L.js +1 -0
- package/dist/chunk-D2PATZCC.js +1 -0
- package/dist/chunk-DFLI7ICU.js +0 -0
- package/dist/chunk-EVYHPR3J.js +1 -0
- package/dist/chunk-IPWUDOV5.js +1 -0
- package/dist/chunk-JNFFTNMH.js +1 -0
- package/dist/chunk-JQKS42G4.js +1 -0
- package/dist/chunk-KVSJE4XD.js +1 -0
- package/dist/chunk-MZZCDXFB.js +1 -0
- package/dist/chunk-ORIDWL3T.js +0 -0
- package/dist/{chunk-RXDTAWI2.js → chunk-PCFF4LLO.js} +1 -1
- package/dist/chunk-QB3NL7VQ.js +1 -0
- package/dist/chunk-TAUWDQZF.js +9 -0
- package/dist/chunk-UG22Z42P.js +1 -0
- package/dist/chunk-VS2D4B3W.js +1 -0
- package/dist/chunk-WQ3WMMZD.js +1 -0
- package/dist/chunk-XK63E4SX.js +1 -0
- package/dist/chunk-YAOXFYOD.js +1 -0
- package/dist/chunk-ZRT3ZQVH.js +1 -0
- package/dist/collision-builder-B_tm8OVy.d.ts +49 -0
- package/dist/core.d.ts +45 -30
- package/dist/core.js +1 -24
- package/dist/debug-state-DRoeasG2.d.ts +17 -0
- package/dist/debug.d.ts +71 -19
- package/dist/debug.js +1 -1
- package/dist/{default-controls-BGc61yYl.d.ts → default-controls-CAKJ5zlo.d.ts} +3 -3
- package/dist/entity-B9yZeBm4.d.ts +34 -0
- package/dist/{entity-DNkYKfdp.d.ts → entity-BGEq1yfC.d.ts} +91 -444
- package/dist/{entity-type-map-C94h2TDW.d.ts → entity-type-map-CW6RHQkx.d.ts} +153 -6
- package/dist/entity.d.ts +15 -10
- package/dist/entity.js +1 -1
- package/dist/events.d.ts +10 -1
- package/dist/events.js +1 -1
- package/dist/{game-Cuj5gy7U.d.ts → game-DbqBQiFC.d.ts} +460 -135
- package/dist/game-default-6AZZCNST.js +1 -0
- package/dist/{game-interfaces-tfpM5NBk.d.ts → game-interfaces-vF5sRi1n.d.ts} +8 -2
- package/dist/globals.d.ts +12 -1
- package/dist/globals.js +1 -1
- package/dist/graphics.d.ts +16 -46
- package/dist/graphics.js +1 -1
- package/dist/input-ui.d.ts +5 -4
- package/dist/input-ui.js +1 -1
- package/dist/input.d.ts +48 -4
- package/dist/input.js +1 -1
- package/dist/{material-Wz83vTTp.d.ts → material-DbSuZBbP.d.ts} +25 -50
- package/dist/public.d.ts +38 -0
- package/dist/public.js +1 -0
- package/dist/runtime.d.ts +7 -381
- package/dist/runtime.js +1 -1
- package/dist/schema/entity.schema.json +244 -0
- package/dist/schema/game-config.schema.json +643 -0
- package/dist/schema/input-config.schema.json +517 -0
- package/dist/schema/stage-config.schema.json +93 -0
- package/dist/schema/stage.schema.json +271 -0
- package/dist/schema.d.ts +550 -0
- package/dist/schema.js +1 -0
- package/dist/stage-transition-CmGpV4tc.d.ts +46 -0
- package/dist/vector-DN6zlPoE.d.ts +161 -0
- package/dist/web-components.d.ts +15 -12
- package/dist/web-components.js +1 -9
- package/dist/{zylem-stage-runtime-Cs-UDEVU.d.ts → zylem-camera-Du2UPW9O.d.ts} +74 -264
- package/package.json +28 -20
- package/dist/chunk-73VZQZUL.js +0 -1
- package/dist/chunk-A34ZG3L4.js +0 -1
- package/dist/chunk-CDPY4VOQ.js +0 -1
- package/dist/chunk-DR6XXZE7.js +0 -19
- package/dist/chunk-FM5TBEPO.js +0 -1
- package/dist/chunk-G2IIMSUH.js +0 -1
- package/dist/chunk-MSC2BEO5.js +0 -1
- package/dist/chunk-NIH5CONO.js +0 -1
- package/dist/chunk-ONWXGBWB.js +0 -1
- package/dist/chunk-QEDQDR27.js +0 -1
- package/dist/chunk-WKHW2QO2.js +0 -1
- package/dist/chunk-YHKXQ2ZN.js +0 -1
- package/dist/game-default-PZLLHYL7.js +0 -1
- package/dist/world-C9zdyl5d.d.ts +0 -103
package/dist/world-C9zdyl5d.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { Group, Mesh, Vector3 } from 'three';
|
|
2
|
-
import RAPIER, { RigidBody, Collider, KinematicCharacterController, World } from '@dimforge/rapier3d-compat';
|
|
3
|
-
import { V as Vec3Components } from './material-Wz83vTTp.js';
|
|
4
|
-
import { f as UpdateContext } from './base-node-life-cycle-CnJ-7zX-.js';
|
|
5
|
-
import { G as GameEntity } from './entity-DNkYKfdp.js';
|
|
6
|
-
|
|
7
|
-
type LifecycleFunction<T> = (params?: any) => void;
|
|
8
|
-
interface Entity<T = any> {
|
|
9
|
-
setup: (entity: T) => void;
|
|
10
|
-
destroy: () => void;
|
|
11
|
-
update: LifecycleFunction<T>;
|
|
12
|
-
type: string;
|
|
13
|
-
_collision?: (entity: any, other: any, globals?: any) => void;
|
|
14
|
-
_destroy?: (globals?: any) => void;
|
|
15
|
-
name?: string;
|
|
16
|
-
tag?: Set<string>;
|
|
17
|
-
}
|
|
18
|
-
interface StageEntity extends Entity {
|
|
19
|
-
uuid: string;
|
|
20
|
-
body: RigidBody;
|
|
21
|
-
group: Group;
|
|
22
|
-
mesh: Mesh;
|
|
23
|
-
instanceId: number;
|
|
24
|
-
collider: Collider;
|
|
25
|
-
controlledRotation: boolean;
|
|
26
|
-
/** When true, a Rapier KinematicCharacterController is allocated on this entity. Opt-in; default false. */
|
|
27
|
-
useCharacterController?: boolean;
|
|
28
|
-
characterController: KinematicCharacterController;
|
|
29
|
-
name: string;
|
|
30
|
-
markedForRemoval: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Interface for entities that handle collision events.
|
|
35
|
-
*/
|
|
36
|
-
interface CollisionHandlerDelegate {
|
|
37
|
-
handlePostCollision(params: any): boolean;
|
|
38
|
-
handleIntersectionEvent(params: any): void;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Physics world wrapper.
|
|
42
|
-
*
|
|
43
|
-
* Owns a single Rapier world that lives on the main thread and is advanced
|
|
44
|
-
* with a fixed-timestep accumulator. The off-thread JS Web Worker physics
|
|
45
|
-
* path that previously sat alongside this implementation has been removed;
|
|
46
|
-
* the long-term off-main-thread story is the wasm runtime adapter, which
|
|
47
|
-
* sits behind {@link StageRuntimeAdapter} rather than inside this class.
|
|
48
|
-
*/
|
|
49
|
-
declare class ZylemWorld implements Entity<ZylemWorld> {
|
|
50
|
-
type: string;
|
|
51
|
-
world: World;
|
|
52
|
-
collisionMap: Map<string, GameEntity<any>>;
|
|
53
|
-
collisionBehaviorMap: Map<string, GameEntity<any>>;
|
|
54
|
-
_removalMap: Map<string, GameEntity<any>>;
|
|
55
|
-
private activeCollisionPairs;
|
|
56
|
-
private currentCollisionTimeMs;
|
|
57
|
-
/** Fixed timestep in seconds used for each physics step. */
|
|
58
|
-
readonly fixedTimestep: number;
|
|
59
|
-
/** Unprocessed time carried over between frames. */
|
|
60
|
-
private accumulator;
|
|
61
|
-
/** Maximum number of physics steps allowed per frame to prevent spiral-of-death. */
|
|
62
|
-
private static readonly MAX_STEPS_PER_FRAME;
|
|
63
|
-
/**
|
|
64
|
-
* Interpolation alpha (0..1) representing the fraction of an unprocessed
|
|
65
|
-
* timestep remaining after the last physics step. Can be used to interpolate
|
|
66
|
-
* rendering transforms between the previous and current physics state.
|
|
67
|
-
*/
|
|
68
|
-
interpolationAlpha: number;
|
|
69
|
-
private readonly trackedDirectBodies;
|
|
70
|
-
static loadPhysics(gravity: Vector3 | Vec3Components): Promise<RAPIER.World>;
|
|
71
|
-
/**
|
|
72
|
-
* @param world The Rapier physics world instance.
|
|
73
|
-
* @param physicsRate Physics update rate in Hz (default 60).
|
|
74
|
-
*/
|
|
75
|
-
constructor(world: World, physicsRate?: number);
|
|
76
|
-
addEntity(entity: any): void;
|
|
77
|
-
setForRemoval(entity: any): void;
|
|
78
|
-
destroyEntity(entity: GameEntity<any>): void;
|
|
79
|
-
setup(): void;
|
|
80
|
-
/**
|
|
81
|
-
* Advance the physics simulation using the fixed-timestep accumulator.
|
|
82
|
-
*/
|
|
83
|
-
update(params: UpdateContext<any>): void;
|
|
84
|
-
private addEntityDirect;
|
|
85
|
-
private destroyEntityDirect;
|
|
86
|
-
private updateDirect;
|
|
87
|
-
private captureDirectBodyPreviousPoses;
|
|
88
|
-
private captureDirectBodyCurrentPoses;
|
|
89
|
-
private patchDirectBodyPoseTracking;
|
|
90
|
-
updatePostCollisionBehaviors(delta: number): void;
|
|
91
|
-
private processPendingRemovals;
|
|
92
|
-
private removeEntityFromTracking;
|
|
93
|
-
private pruneActiveCollisionPairs;
|
|
94
|
-
private collectCollisionPairsFromWorld;
|
|
95
|
-
private entityHasCollisionPhaseListener;
|
|
96
|
-
private processCollisionPairs;
|
|
97
|
-
private dispatchCollisionPhase;
|
|
98
|
-
private dispatchIntersectionDelegates;
|
|
99
|
-
destroy(): void;
|
|
100
|
-
private clearEntityPhysicsState;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export { type CollisionHandlerDelegate as C, type Entity as E, type LifecycleFunction as L, type StageEntity as S, ZylemWorld as Z };
|