@zylem/game-lib 0.9.5 → 0.9.7
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/dist/actions.d.ts +3 -3
- package/dist/api/game-lib.api.json +100288 -42733
- package/dist/api/game-lib.api.md +3842 -685
- package/dist/api/game-lib.d.ts +8934 -818
- package/dist/api/game-lib.typedoc.json +327569 -192737
- package/dist/behavior/action/fighting.d.ts +1 -0
- package/dist/behavior/action/fighting.js +1 -0
- package/dist/behavior/action/pinball.d.ts +1 -0
- package/dist/behavior/action/pinball.js +1 -0
- package/dist/behavior/action/platform.d.ts +1 -0
- package/dist/behavior/action/platform.js +1 -0
- package/dist/behavior/action/rhythm.d.ts +1 -0
- package/dist/behavior/action/rhythm.js +1 -0
- package/dist/behavior/action/shooter/first-person.d.ts +1 -0
- package/dist/behavior/action/shooter/first-person.js +1 -0
- package/dist/behavior/action/shooter/shoot-em-up.d.ts +1 -0
- package/dist/behavior/action/shooter/shoot-em-up.js +1 -0
- package/dist/behavior/action/shooter.d.ts +1 -0
- package/dist/behavior/action/shooter.js +1 -0
- package/dist/behavior/action/stealth.d.ts +1 -0
- package/dist/behavior/action/stealth.js +1 -0
- package/dist/behavior/action/survival.d.ts +1 -0
- package/dist/behavior/action/survival.js +1 -0
- package/dist/behavior/action-adventure.d.ts +1 -0
- package/dist/behavior/action-adventure.js +1 -0
- package/dist/behavior/action.d.ts +1 -0
- package/dist/behavior/action.js +1 -0
- package/dist/behavior/genre-map.d.ts +1 -0
- package/dist/behavior/genre-map.js +1 -0
- package/dist/behavior/mechanics.d.ts +1 -0
- package/dist/behavior/mechanics.js +1 -0
- package/dist/behavior/puzzle/physics.d.ts +1 -0
- package/dist/behavior/puzzle/physics.js +1 -0
- package/dist/behavior/puzzle/tile-matching.d.ts +1 -0
- package/dist/behavior/puzzle/tile-matching.js +1 -0
- package/dist/behavior/puzzle.d.ts +1 -0
- package/dist/behavior/puzzle.js +1 -0
- package/dist/behavior/role-playing/action-rpg.d.ts +1 -0
- package/dist/behavior/role-playing/action-rpg.js +1 -0
- package/dist/behavior/role-playing/monster-taming.d.ts +1 -0
- package/dist/behavior/role-playing/monster-taming.js +1 -0
- package/dist/behavior/role-playing/tactical-rpg.d.ts +1 -0
- package/dist/behavior/role-playing/tactical-rpg.js +1 -0
- package/dist/behavior/role-playing/turn-based.d.ts +1 -0
- package/dist/behavior/role-playing/turn-based.js +1 -0
- package/dist/behavior/role-playing.d.ts +1 -0
- package/dist/behavior/role-playing.js +1 -0
- package/dist/behavior/simulation/life.d.ts +1 -0
- package/dist/behavior/simulation/life.js +1 -0
- package/dist/behavior/simulation/vehicle/racing.d.ts +1 -0
- package/dist/behavior/simulation/vehicle/racing.js +1 -0
- package/dist/behavior/simulation/vehicle.d.ts +1 -0
- package/dist/behavior/simulation/vehicle.js +1 -0
- package/dist/behavior/simulation.d.ts +1 -0
- package/dist/behavior/simulation.js +1 -0
- package/dist/behavior/sports/golf.d.ts +1 -0
- package/dist/behavior/sports/golf.js +1 -0
- package/dist/behavior/sports/racing.d.ts +1 -0
- package/dist/behavior/sports/racing.js +1 -0
- package/dist/behavior/sports/racket.d.ts +1 -0
- package/dist/behavior/sports/racket.js +1 -0
- package/dist/behavior/sports/skate.d.ts +1 -0
- package/dist/behavior/sports/skate.js +1 -0
- package/dist/behavior/sports.d.ts +1 -0
- package/dist/behavior/sports.js +1 -0
- package/dist/behavior/strategy/real-time-tactics.d.ts +1 -0
- package/dist/behavior/strategy/real-time-tactics.js +1 -0
- package/dist/behavior/strategy/tower-defense.d.ts +1 -0
- package/dist/behavior/strategy/tower-defense.js +1 -0
- package/dist/behavior/strategy/turn-based-tactics.d.ts +1 -0
- package/dist/behavior/strategy/turn-based-tactics.js +1 -0
- package/dist/behavior/strategy.d.ts +1 -0
- package/dist/behavior/strategy.js +1 -0
- package/dist/behavior.d.ts +34 -0
- package/dist/bridge.d.ts +9 -2
- package/dist/bridge.js +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/{chunk-BQRMYLYD.js → chunk-273CUPEO.js} +1 -1
- package/dist/chunk-4DAITCJS.js +1 -0
- package/dist/chunk-63T3K5EQ.js +1 -0
- package/dist/chunk-AJSIVGDX.js +1 -0
- package/dist/chunk-CVKEWWIH.js +1 -0
- package/dist/chunk-DYD7MDWO.js +1 -0
- package/dist/chunk-IHGRFR4H.js +1 -0
- package/dist/{chunk-4CZZZCFB.js → chunk-JCGW5PIR.js} +1 -1
- package/dist/{chunk-2IJLXFWY.js → chunk-JJEYLGD2.js} +4 -4
- package/dist/chunk-KL7NGD76.js +1 -0
- package/dist/chunk-M2FZ224T.js +1 -0
- package/dist/chunk-MJ7RGE47.js +1 -0
- package/dist/chunk-Q22Z4PBD.js +19 -0
- package/dist/chunk-SD7EHS4W.js +1 -0
- package/dist/chunk-UKNMIHAP.js +1 -0
- package/dist/chunk-UM5VNQPY.js +1 -0
- package/dist/chunk-Y5IU6IA5.js +1 -0
- package/dist/cinematics.d.ts +8 -5
- package/dist/core.d.ts +25 -10
- package/dist/core.js +1 -1
- package/dist/{debug-state-Cg3f5FB6.d.ts → debug-state-BgX5Q0Ff.d.ts} +2 -2
- package/dist/debug.d.ts +6 -125
- package/dist/debug.js +1 -1
- package/dist/{entity-XqvuWgPm.d.ts → entity-CY75JJSw.d.ts} +83 -4
- package/dist/{entity-type-map-CrsrKT8c.d.ts → entity-type-map-BMaPY8cd.d.ts} +53 -14
- package/dist/entity.d.ts +6 -18
- package/dist/entity.js +1 -1
- package/dist/{game-DBt7iVu4.d.ts → game-CmkhPP-9.d.ts} +8 -8
- package/dist/game-default-LAGMEHNQ.js +1 -0
- package/dist/graphics.d.ts +3 -3
- package/dist/graphics.js +1 -1
- package/dist/level-types-D10LiOcn.d.ts +91 -0
- package/dist/{material-CxxAyJYp.d.ts → material-D1IVeQc5.d.ts} +48 -2
- package/dist/placement-session-BNQoL7Jb.d.ts +82 -0
- package/dist/placement.d.ts +52 -0
- package/dist/placement.js +1 -0
- package/dist/public.d.ts +14 -10
- package/dist/public.js +1 -1
- package/dist/{stage-PBmwT5-Y.d.ts → stage-CCGJh9TD.d.ts} +189 -7
- package/dist/transform-gizmo-DappLQ9w.d.ts +123 -0
- package/dist/web-components.d.ts +10 -7
- package/dist/web-components.js +1 -1
- package/dist/{zylem-camera-CWhIGXlW.d.ts → zylem-camera-BA3VPFlS.d.ts} +9 -0
- package/package.json +147 -7
- package/dist/chunk-3CLQWJ2I.js +0 -1
- package/dist/chunk-6FGXC4T6.js +0 -19
- package/dist/chunk-GPCSX3M6.js +0 -1
- package/dist/chunk-K3NNXZIJ.js +0 -1
- package/dist/chunk-KP6DLLJO.js +0 -1
- package/dist/chunk-LI43BZQN.js +0 -1
- package/dist/chunk-NK4IXK5V.js +0 -1
- package/dist/chunk-QB3NL7VQ.js +0 -1
- package/dist/chunk-STVEILJJ.js +0 -1
- package/dist/chunk-VSFULLND.js +0 -1
- package/dist/chunk-YQS7CGXE.js +0 -1
- package/dist/game-default-BAZPDNPS.js +0 -1
package/dist/core.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { S as StageStateInterface } from './game-
|
|
2
|
-
export { A as AspectRatio, f as AspectRatioValue, D as DeviceProfile, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, R as ResolutionInput, e as ResolveGameConfigRuntime, j as RetroPreset, k as RetroPresetKey, l as RetroResolution, c as createGame, g as gameConfig, h as getDisplayAspect, i as getPresetResolution, p as parseResolution } from './game-
|
|
1
|
+
import { S as StageStateInterface } from './game-CmkhPP-9.js';
|
|
2
|
+
export { A as AspectRatio, f as AspectRatioValue, D as DeviceProfile, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, R as ResolutionInput, e as ResolveGameConfigRuntime, j as RetroPreset, k as RetroPresetKey, l as RetroResolution, c as createGame, g as gameConfig, h as getDisplayAspect, i as getPresetResolution, p as parseResolution } from './game-CmkhPP-9.js';
|
|
3
3
|
export { G as GameInputConfig, a as GameInputPlayerConfig, K as KeyboardMapping, M as MouseConfig, b as MouseMapping, V as VirtualTouchButtonConfig, d as VirtualTouchButtonSlot, c as VirtualTouchButtonsConfig, e as VirtualTouchConfig, f as VirtualTouchJoystickConfig, g as VirtualTouchJoysticksConfig, h as VirtualTouchPosition, i as VirtualTouchStyle, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
|
|
4
|
-
import { q as Stage, C as CameraWrapper } from './stage-
|
|
5
|
-
export { e as CameraManager, d as CameraOptions, l as FirstPersonOptions, f as FirstPersonPerspective, k as Fixed2DOptions, F as Fixed2DPerspective, n as IsometricOptions, I as IsometricPerspective, P as PerspectiveOptions, R as RenderBundleManager, p as RenderStrategyManager, m as SecondPersonOptions, g as SecondPersonPerspective, S as StageConfigLike, a as StageOptions, j as ThirdPersonOptions, T as ThirdPersonPerspective, o as TopDownOptions, h as TopDownPerspective, b as createCamera, i as createPerspective, c as createStage, s as stageConfig } from './stage-
|
|
4
|
+
import { q as Stage, C as CameraWrapper } from './stage-CCGJh9TD.js';
|
|
5
|
+
export { e as CameraManager, d as CameraOptions, l as FirstPersonOptions, f as FirstPersonPerspective, k as Fixed2DOptions, F as Fixed2DPerspective, n as IsometricOptions, I as IsometricPerspective, P as PerspectiveOptions, R as RenderBundleManager, p as RenderStrategyManager, m as SecondPersonOptions, g as SecondPersonPerspective, S as StageConfigLike, a as StageOptions, j as ThirdPersonOptions, T as ThirdPersonPerspective, o as TopDownOptions, h as TopDownPerspective, b as createCamera, i as createPerspective, c as createStage, s as stageConfig } from './stage-CCGJh9TD.js';
|
|
6
6
|
import { LevelBuffer, LevelEntry } from '@zylem/bridge';
|
|
7
7
|
export { LevelBuffer } from '@zylem/bridge';
|
|
8
8
|
import { B as BaseNode, N as NodeInterface } from './base-node-idopiSw5.js';
|
|
9
|
+
import { L as LevelDocument } from './level-types-D10LiOcn.js';
|
|
9
10
|
import { Vector2 } from 'three';
|
|
10
|
-
import { G as GameEntity,
|
|
11
|
+
import { G as GameEntity, d as GameEntityOptions } from './entity-CY75JJSw.js';
|
|
12
|
+
export { A as ArmPlacementOptions, P as PlacementSession } from './placement-session-BNQoL7Jb.js';
|
|
11
13
|
import { S as StageBlueprint } from './blueprints-TbGY-h53.js';
|
|
12
14
|
import { a as SetupContext, k as LoadedContext, U as UpdateContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
|
|
13
15
|
export { L as LoadingEvent, S as StageNavigationOptions } from './base-node-life-cycle-BK9xebT9.js';
|
|
14
16
|
export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
|
|
15
|
-
import { f as CameraBehavior } from './zylem-camera-
|
|
16
|
-
export { g as CameraAction, d as CameraContext, e as CameraPerspective, k as CameraPipeline, h as CameraPipelineState, C as CameraPose, j as CameraProjection, P as PerspectiveType, a as Perspectives, c as PoseDelta, T as TransformLike, V as Viewport, b as ZylemRenderer, i as isWebGPUSupported } from './zylem-camera-
|
|
17
|
+
import { f as CameraBehavior } from './zylem-camera-BA3VPFlS.js';
|
|
18
|
+
export { g as CameraAction, d as CameraContext, e as CameraPerspective, k as CameraPipeline, h as CameraPipelineState, C as CameraPose, j as CameraProjection, P as PerspectiveType, a as Perspectives, c as PoseDelta, T as TransformLike, V as Viewport, b as ZylemRenderer, i as isWebGPUSupported } from './zylem-camera-BA3VPFlS.js';
|
|
17
19
|
import { e as Vec3Input, c as Vec3 } from './vector-D3eDzvcA.js';
|
|
18
20
|
export { f as VEC2_ONE, g as VEC2_ZERO, h as VEC3_ONE, i as VEC3_ZERO, V as Vec2, a as Vec2Components, b as Vec2Input, d as Vec3Components, n as normalizeVec2, j as normalizeVec3, t as toThreeVector2, k as toThreeVector3 } from './vector-D3eDzvcA.js';
|
|
19
21
|
import { S as StageEntity } from './entity-BIf_a4dl.js';
|
|
@@ -21,13 +23,14 @@ import './default-controls-CAKJ5zlo.js';
|
|
|
21
23
|
import './events.js';
|
|
22
24
|
import 'mitt';
|
|
23
25
|
import '@zylem/behaviors/core';
|
|
24
|
-
import './entity-type-map-
|
|
25
|
-
import './material-
|
|
26
|
+
import './entity-type-map-BMaPY8cd.js';
|
|
27
|
+
import './material-D1IVeQc5.js';
|
|
26
28
|
import 'three/webgpu';
|
|
27
29
|
import './selection-bounds-BKmSo9aG.js';
|
|
28
30
|
import '@zylem/behaviors/particle-emitter';
|
|
29
31
|
import 'three/addons/lines/webgpu/Line2.js';
|
|
30
32
|
import './simulation-body-zQw-emOr.js';
|
|
33
|
+
import './transform-gizmo-DappLQ9w.js';
|
|
31
34
|
import './collision-builder-BckxkdmA.js';
|
|
32
35
|
import '@sinclair/typebox';
|
|
33
36
|
|
|
@@ -78,6 +81,18 @@ interface LevelStage {
|
|
|
78
81
|
*/
|
|
79
82
|
declare function streamLevelOnStage(stage: LevelStage, buffer: LevelBuffer, options?: StreamLevelOptions): Promise<StreamLevelResult>;
|
|
80
83
|
|
|
84
|
+
/**
|
|
85
|
+
* The stage's picture of the level document.
|
|
86
|
+
*
|
|
87
|
+
* The editor owns the file. This session draws it, reports finished gestures,
|
|
88
|
+
* and on play swaps the brush faces for one static body of convex hulls.
|
|
89
|
+
* Nothing it creates is a normal stage entity except play-mode trigger zones,
|
|
90
|
+
* and those are marked editor-owned so they are not published back.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/** The document currently previewed or playing, for hosts that spawn from markers. */
|
|
94
|
+
declare function getActiveLevelDocument(): LevelDocument | null;
|
|
95
|
+
|
|
81
96
|
/**
|
|
82
97
|
* Authoring helper for spawning entities into a live stage at runtime.
|
|
83
98
|
*
|
|
@@ -386,4 +401,4 @@ declare function isManagedRenderEntity(entity: {
|
|
|
386
401
|
*/
|
|
387
402
|
type Vect3 = Vec3;
|
|
388
403
|
|
|
389
|
-
export { CameraBehavior, type CameraFeedOptions, CameraWrapper, type FollowTargetOptions, type LevelStage, type PlatformAxisMode, type PlatformAxisModes, type PlatformFollowOptions, type RenderCategory, STAGE_STATE_CHANGE, SetupContext, StageBlueprint, StageEntity, StageManager, type StageStateChangeEvent, type StrategyPanBehavior, type StrategyPanInput, type StrategyPanOptions, type StrategyPointer, type StreamLevelOptions, type StreamLevelResult, UpdateContext, Vec3, Vec3Input, type Vect3, createFollowTarget, createPlatformFollow, createStrategyPan, dispatchStageState, entitySpawner, initStageStateDispatcher, isManagedRenderEntity, resolveRenderCategory, setCameraFeed, setStageFrameProfilerEnabled, stageState, streamLevel, streamLevelOnStage, usesManagedRenderPath, vessel };
|
|
404
|
+
export { CameraBehavior, type CameraFeedOptions, CameraWrapper, type FollowTargetOptions, LevelDocument, type LevelStage, type PlatformAxisMode, type PlatformAxisModes, type PlatformFollowOptions, type RenderCategory, STAGE_STATE_CHANGE, SetupContext, StageBlueprint, StageEntity, StageManager, type StageStateChangeEvent, type StrategyPanBehavior, type StrategyPanInput, type StrategyPanOptions, type StrategyPointer, type StreamLevelOptions, type StreamLevelResult, UpdateContext, Vec3, Vec3Input, type Vect3, createFollowTarget, createPlatformFollow, createStrategyPan, dispatchStageState, entitySpawner, getActiveLevelDocument, initStageStateDispatcher, isManagedRenderEntity, resolveRenderCategory, setCameraFeed, setStageFrameProfilerEnabled, stageState, streamLevel, streamLevelOnStage, usesManagedRenderPath, vessel };
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f,f as
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as M,g as N,h as O,i as P,j as Q,k as R,l as S,m as T,n as U,o as V,p as W,q as X,r as Y}from"./chunk-JJEYLGD2.js";import{a,c as q,d as r,e as s,f as t,g as u,h as v,i as w,j as x,l as y,m as z,n as A,o as B,p as C,q as D,r as E,s as F,t as G,u as H,v as I,w as J,x as K,z as L}from"./chunk-UKNMIHAP.js";import{e as g}from"./chunk-KL7NGD76.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-PCFF4LLO.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-OCQ7A5IK.js";import"./chunk-47HAZZWF.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-SD7EHS4W.js";import"./chunk-2HSR5XDQ.js";import"./chunk-2XMG3NJS.js";import{a as p}from"./chunk-7GYFZKK7.js";import"./chunk-QGIYILYI.js";import"./chunk-D2PATZCC.js";import"./chunk-63T3K5EQ.js";import"./chunk-M2FZ224T.js";import"./chunk-DYD7MDWO.js";import"./chunk-IHGRFR4H.js";import"./chunk-AJSIVGDX.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-Q22Z4PBD.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-UUOPT2N4.js";import"./chunk-4QLJUQSJ.js";import{a as h,b as i,c as j,d as k,g as l,h as m,i as n,j as o}from"./chunk-7WRQ2UAN.js";import"./chunk-VUJXR5K5.js";import"./chunk-WOT6VMZA.js";export{b as AspectRatio,G as CameraManager,y as CameraPipeline,H as CameraWrapper,B as FirstPersonPerspective,A as Fixed2DPerspective,O as Game,C as IsometricPerspective,x as Perspectives,t as RenderBundleManager,u as RenderStrategyManager,S as STAGE_STATE_CHANGE,E as SecondPersonPerspective,N as StageManager,z as ThirdPersonPerspective,D as TopDownPerspective,i as VEC2_ONE,h as VEC2_ZERO,k as VEC3_ONE,j as VEC3_ZERO,I as createCamera,V as createFollowTarget,P as createGame,F as createPerspective,W as createPlatformFollow,L as createStage,X as createStrategyPan,p as crossfadeTransitionShader,U as dispatchStageState,R as entitySpawner,f as gameConfig,v as getActiveLevelDocument,c as getDisplayAspect,d as getPresetResolution,T as initStageStateDispatcher,s as isManagedRenderEntity,a as isWebGPUSupported,l as normalizeVec2,m as normalizeVec3,e as parseResolution,q as resolveRenderCategory,Y as setCameraFeed,w as setStageFrameProfilerEnabled,J as stageConfig,M as stageState,g as streamLevel,Q as streamLevelOnStage,n as toThreeVector2,o as toThreeVector3,r as usesManagedRenderPath,K as vessel};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GameEntity } from './entity-
|
|
1
|
+
import { G as GameEntity } from './entity-CY75JJSw.js';
|
|
2
2
|
|
|
3
|
-
type DebugTools = 'select' | 'translate' | 'rotate' | 'scale' | 'delete' | 'add' | 'none';
|
|
3
|
+
type DebugTools = 'select' | 'translate' | 'rotate' | 'scale' | 'delete' | 'add' | 'brush' | 'clip' | 'vertex' | 'none';
|
|
4
4
|
/** Tools that manipulate a selected entity's transform via the gizmo. */
|
|
5
5
|
declare const TRANSFORM_TOOLS: readonly ["translate", "rotate", "scale"];
|
|
6
6
|
type TransformTool = (typeof TRANSFORM_TOOLS)[number];
|
package/dist/debug.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { D as DEFAULT_SNAP_SETTINGS, w as DebugEntityResolver, v as DebugTools, S as SnapSettings, T as TRANSFORM_TOOLS, x as TransformTool, d as debugState, k as getHoveredEntity, j as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, h as getSelectedEntityIds, m as getSnapSettings, t as isPickMode, u as isTransformTool, r as registerDebugEntityResolver, l as resolveDebugEntity, p as setAddType, s as setDebugTool, o as setGridVisible, i as setHoveredEntityId, a as setPaused, q as setPickMode, b as setSelectedEntity, c as setSelectedEntityId, f as setSelectedEntityIds, n as setSnapSettings } from './debug-state-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
export { D as DEFAULT_SNAP_SETTINGS, w as DebugEntityResolver, v as DebugTools, S as SnapSettings, T as TRANSFORM_TOOLS, x as TransformTool, d as debugState, k as getHoveredEntity, j as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, h as getSelectedEntityIds, m as getSnapSettings, t as isPickMode, u as isTransformTool, r as registerDebugEntityResolver, l as resolveDebugEntity, p as setAddType, s as setDebugTool, o as setGridVisible, i as setHoveredEntityId, a as setPaused, q as setPickMode, b as setSelectedEntity, c as setSelectedEntityId, f as setSelectedEntityIds, n as setSnapSettings } from './debug-state-BgX5Q0Ff.js';
|
|
2
|
+
export { G as GizmoAxis, a as GizmoDelta, b as GizmoMode, d as GizmoRay, T as TransformGizmo, c as closestAxisValue, i as intersectPlane } from './transform-gizmo-DappLQ9w.js';
|
|
3
|
+
import { Scene, Object3D, Vector3 } from 'three';
|
|
4
4
|
import { c as Vec3 } from './vector-D3eDzvcA.js';
|
|
5
|
-
import { G as GameEntity } from './entity-
|
|
5
|
+
import { G as GameEntity } from './entity-CY75JJSw.js';
|
|
6
6
|
export { S as SELECTION_BOUNDS_MARGIN, a as SELECTION_THIN_AXIS_FRACTION, c as SELECTION_THIN_AXIS_MAX, b as SELECTION_THIN_AXIS_MIN, d as SelectionBoundsProvider, m as measureObjectSelectionBounds, p as padSelectionBounds, r as resolveSelectionBounds } from './selection-bounds-BKmSo9aG.js';
|
|
7
7
|
import { WebGPURenderer } from 'three/webgpu';
|
|
8
8
|
import '@zylem/behaviors/core';
|
|
9
9
|
import './simulation-body-zQw-emOr.js';
|
|
10
|
-
import './material-
|
|
10
|
+
import './material-D1IVeQc5.js';
|
|
11
11
|
import './collision-builder-BckxkdmA.js';
|
|
12
12
|
import './base-node-idopiSw5.js';
|
|
13
13
|
import './base-node-life-cycle-BK9xebT9.js';
|
|
@@ -15,125 +15,6 @@ import './stage-transition-CmGpV4tc.js';
|
|
|
15
15
|
import './events.js';
|
|
16
16
|
import 'mitt';
|
|
17
17
|
|
|
18
|
-
type GizmoMode = 'translate' | 'rotate' | 'scale';
|
|
19
|
-
/** Single-axis, planar, and uniform handle identifiers. */
|
|
20
|
-
type GizmoAxis = 'x' | 'y' | 'z' | 'xy' | 'yz' | 'xz' | 'xyz';
|
|
21
|
-
/** A raw, unsnapped drag result in world space. */
|
|
22
|
-
type GizmoDelta = {
|
|
23
|
-
kind: 'translate';
|
|
24
|
-
offset: Vector3;
|
|
25
|
-
} | {
|
|
26
|
-
kind: 'rotate';
|
|
27
|
-
axis: Vector3;
|
|
28
|
-
angle: number;
|
|
29
|
-
} | {
|
|
30
|
-
kind: 'scale';
|
|
31
|
-
factor: Vector3;
|
|
32
|
-
};
|
|
33
|
-
/** A mouse ray in world space. */
|
|
34
|
-
interface GizmoRay {
|
|
35
|
-
origin: Vector3;
|
|
36
|
-
direction: Vector3;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Closest point along an infinite line to a ray, as a distance along the line.
|
|
40
|
-
*
|
|
41
|
-
* Returns `null` when the ray is close enough to parallel with the line that the
|
|
42
|
-
* closest point becomes unstable; see {@link MAX_DRAG_GAIN}.
|
|
43
|
-
*/
|
|
44
|
-
declare function closestAxisValue(ray: GizmoRay, origin: Vector3, axis: Vector3): number | null;
|
|
45
|
-
/**
|
|
46
|
-
* Intersect a ray with the plane through `origin` with the given normal.
|
|
47
|
-
*
|
|
48
|
-
* Returns `null` for a plane seen too close to edge-on, where the hit point
|
|
49
|
-
* races away across the plane for very little pointer motion.
|
|
50
|
-
*/
|
|
51
|
-
declare function intersectPlane(ray: GizmoRay, origin: Vector3, normal: Vector3, target: Vector3): Vector3 | null;
|
|
52
|
-
declare class TransformGizmo {
|
|
53
|
-
/** Root added to the scene; carries the pivot transform. */
|
|
54
|
-
readonly root: Group<three.Object3DEventMap>;
|
|
55
|
-
private scene;
|
|
56
|
-
private modeGroups;
|
|
57
|
-
private handles;
|
|
58
|
-
private materials;
|
|
59
|
-
private geometries;
|
|
60
|
-
private mode;
|
|
61
|
-
private highlighted;
|
|
62
|
-
private drag;
|
|
63
|
-
private raycaster;
|
|
64
|
-
constructor();
|
|
65
|
-
addTo(scene: Scene): void;
|
|
66
|
-
removeFromScene(): void;
|
|
67
|
-
dispose(): void;
|
|
68
|
-
setMode(mode: GizmoMode): void;
|
|
69
|
-
getMode(): GizmoMode;
|
|
70
|
-
/** Place the gizmo at a pivot and show it. */
|
|
71
|
-
show(pivot: Vector3): void;
|
|
72
|
-
hide(): void;
|
|
73
|
-
get visible(): boolean;
|
|
74
|
-
get pivot(): Vector3;
|
|
75
|
-
/**
|
|
76
|
-
* Keep the gizmo a constant size on screen.
|
|
77
|
-
*
|
|
78
|
-
* A world-sized gizmo is unusable in an orbit view: it fills the screen up
|
|
79
|
-
* close and disappears from a distance.
|
|
80
|
-
*/
|
|
81
|
-
update(camera: Camera): void;
|
|
82
|
-
/**
|
|
83
|
-
* Which handle a ray hits, or `null`.
|
|
84
|
-
*
|
|
85
|
-
* Raycasts the gizmo's own meshes rather than the physics world. Handles are
|
|
86
|
-
* render-only objects with no colliders, so the physics raycast used to pick
|
|
87
|
-
* entities cannot see them at all.
|
|
88
|
-
*/
|
|
89
|
-
pick(ray: GizmoRay): GizmoAxis | null;
|
|
90
|
-
/**
|
|
91
|
-
* Whether a handle can be dragged from the current viewing angle.
|
|
92
|
-
*
|
|
93
|
-
* Each handle type degenerates differently: an arrow aimed at the camera has
|
|
94
|
-
* no screen-space direction left to follow, while a plane quad or rotation
|
|
95
|
-
* ring seen edge-on turns a pixel of motion into a huge sweep across it.
|
|
96
|
-
*/
|
|
97
|
-
private isHandleDraggable;
|
|
98
|
-
/** Tint a handle to show it is hovered or being dragged. */
|
|
99
|
-
setHighlight(axis: GizmoAxis | null): void;
|
|
100
|
-
/**
|
|
101
|
-
* Begin a drag on a handle.
|
|
102
|
-
*
|
|
103
|
-
* @returns `false` when the gesture cannot be tracked (a near-parallel view
|
|
104
|
-
* of the drag axis), so the caller can ignore the press rather than start a
|
|
105
|
-
* drag that would jump.
|
|
106
|
-
*/
|
|
107
|
-
beginDrag(axis: GizmoAxis, ray: GizmoRay, camera: Camera): boolean;
|
|
108
|
-
/** Raw delta for the current pointer position, or `null` when unusable. */
|
|
109
|
-
updateDrag(ray: GizmoRay, camera: Camera): GizmoDelta | null;
|
|
110
|
-
endDrag(): void;
|
|
111
|
-
get isDragging(): boolean;
|
|
112
|
-
get draggingAxis(): GizmoAxis | null;
|
|
113
|
-
private isPlaneAxis;
|
|
114
|
-
/** Signed angle of the ray's hit point around `normal`, in radians. */
|
|
115
|
-
private angleOnPlane;
|
|
116
|
-
/** Distance from pivot to the ray hit on the camera-facing plane. */
|
|
117
|
-
private cameraPlaneRadius;
|
|
118
|
-
private applyModeVisibility;
|
|
119
|
-
private makeMaterial;
|
|
120
|
-
private track;
|
|
121
|
-
/**
|
|
122
|
-
* An invisible, generously sized mesh used only for hit testing.
|
|
123
|
-
*
|
|
124
|
-
* The visible shafts and rings are a couple of pixels wide, which is
|
|
125
|
-
* miserable to click. The raycaster still reaches `visible: false` meshes,
|
|
126
|
-
* so picking accuracy is decoupled from how thin the handle looks.
|
|
127
|
-
*/
|
|
128
|
-
private makePicker;
|
|
129
|
-
private orientAlongAxis;
|
|
130
|
-
private buildTranslate;
|
|
131
|
-
private positionPlaneHandle;
|
|
132
|
-
private buildRotate;
|
|
133
|
-
private orientRing;
|
|
134
|
-
private buildScale;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
18
|
/**
|
|
138
19
|
* The y=0 construction plane, drawn so the snap lattice is legible.
|
|
139
20
|
*
|
|
@@ -287,4 +168,4 @@ declare class EntityThumbnailCache {
|
|
|
287
168
|
/** Shared cache used by the running game to feed editor entity payloads. */
|
|
288
169
|
declare const entityThumbnailCache: EntityThumbnailCache;
|
|
289
170
|
|
|
290
|
-
export { ConstructionGrid, type EntityFocusContext, EntityThumbnailCache, type EntityThumbnailCacheEntry, type EntityThumbnailResult, type
|
|
171
|
+
export { ConstructionGrid, type EntityFocusContext, EntityThumbnailCache, type EntityThumbnailCacheEntry, type EntityThumbnailResult, type Quat, degreesToRadians, entityThumbnailCache, eulerToQuaternion, focusEntity, quaternionToEuler, radiansToDegrees, registerEntityFocusContext, snapScale, snapToIncrement, snapVec3 };
|
package/dist/debug.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-ELQN62PQ.js";import{a as x,b as y}from"./chunk-OCQ7A5IK.js";import{c as P,d as Q,e as R,f as S}from"./chunk-47HAZZWF.js";import{a as z,b as A,c as B,d as C,e as D,f as E,g as F,h as G,i as H}from"./chunk-
|
|
1
|
+
import"./chunk-ELQN62PQ.js";import{a as x,b as y}from"./chunk-OCQ7A5IK.js";import{c as P,d as Q,e as R,f as S}from"./chunk-47HAZZWF.js";import{a as z,b as A,c as B,d as C,e as D,f as E,g as F,h as G,i as H}from"./chunk-273CUPEO.js";import{B as u,C as v,D as w,a,b,c,d,e,f,h as g,j as h,l as i,m as j,n as k,o as l,p as m,q as n,u as o,v as p,w as q,x as r,y as s,z as t}from"./chunk-UM5VNQPY.js";import{a as I,b as J,c as K,d as L,e as M,f as N,g as O}from"./chunk-UUOPT2N4.js";import"./chunk-WOT6VMZA.js";export{P as ConstructionGrid,c as DEFAULT_SNAP_SETTINGS,x as EntityThumbnailCache,I as SELECTION_BOUNDS_MARGIN,J as SELECTION_THIN_AXIS_FRACTION,L as SELECTION_THIN_AXIS_MAX,K as SELECTION_THIN_AXIS_MIN,a as TRANSFORM_TOOLS,S as TransformGizmo,Q as closestAxisValue,d as debugState,G as degreesToRadians,y as entityThumbnailCache,B as eulerToQuaternion,A as focusEntity,v as getHoveredEntity,s as getHoveredEntityId,u as getSelectedEntity,k as getSelectedEntityId,m as getSelectedEntityIds,o as getSnapSettings,R as intersectPlane,j as isPickMode,b as isTransformTool,N as measureObjectSelectionBounds,M as padSelectionBounds,C as quaternionToEuler,H as radiansToDegrees,e as registerDebugEntityResolver,z as registerEntityFocusContext,f as resolveDebugEntity,O as resolveSelectionBounds,r as setAddType,h as setDebugTool,q as setGridVisible,t as setHoveredEntityId,g as setPaused,i as setPickMode,w as setSelectedEntity,l as setSelectedEntityId,n as setSelectedEntityIds,p as setSnapSettings,F as snapScale,D as snapToIncrement,E as snapVec3};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BufferGeometry, Material, Mesh, Group, Vector3, Color, ShaderMaterial } from 'three';
|
|
1
|
+
import { BufferGeometry, Material, Mesh, Group, Vector3, Object3D, Color, ShaderMaterial } from 'three';
|
|
2
2
|
import { SimulationColliderDefinition, TransformState, SimulationBodyDefinition, MoveableEntity, BehaviorRuntime, Vector, BehaviorDescriptor, BehaviorHandle, BehaviorRef } from '@zylem/behaviors/core';
|
|
3
3
|
import { a as SimulationBody } from './simulation-body-zQw-emOr.js';
|
|
4
|
-
import { c as Vec3, e as Vec3Input, b as Vec2Input } from './vector-D3eDzvcA.js';
|
|
5
|
-
import { M as MaterialBuilder,
|
|
4
|
+
import { c as Vec3, e as Vec3Input, b as Vec2Input, d as Vec3Components } from './vector-D3eDzvcA.js';
|
|
5
|
+
import { M as MaterialBuilder, g as MaterialOptions } from './material-D1IVeQc5.js';
|
|
6
6
|
import { C as CollisionBuilder, L as LockAxesInput, a as CollisionOptions } from './collision-builder-BckxkdmA.js';
|
|
7
7
|
import { B as BaseNode, N as NodeInterface } from './base-node-idopiSw5.js';
|
|
8
8
|
import { a as SetupContext, U as UpdateContext, D as DestroyContext, k as LoadedContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
|
|
@@ -268,6 +268,68 @@ interface Action {
|
|
|
268
268
|
reset(): void;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Pointer roles for gameplay placement.
|
|
273
|
+
*
|
|
274
|
+
* A hover or droppable area is metadata on an entity plus a box the cursor ray
|
|
275
|
+
* is tested against. The physics raycast is the wrong tool for this: it skips
|
|
276
|
+
* sensors, and an invisible hotspot should not have to be a solid collider to
|
|
277
|
+
* be clickable. Areas with a mesh already in the scene use that mesh's world
|
|
278
|
+
* bounds; everyone else uses `options.position` and `options.size`.
|
|
279
|
+
*/
|
|
280
|
+
|
|
281
|
+
/** Anything the stage can test with a pointer ray. GameEntity satisfies this. */
|
|
282
|
+
interface PointerTargetEntity {
|
|
283
|
+
uuid: string;
|
|
284
|
+
options?: {
|
|
285
|
+
position?: Vec3Input;
|
|
286
|
+
size?: Vec3Input;
|
|
287
|
+
};
|
|
288
|
+
group?: Object3D;
|
|
289
|
+
mesh?: Object3D;
|
|
290
|
+
getPose?: () => {
|
|
291
|
+
position: {
|
|
292
|
+
x: number;
|
|
293
|
+
y: number;
|
|
294
|
+
z: number;
|
|
295
|
+
};
|
|
296
|
+
} | null;
|
|
297
|
+
}
|
|
298
|
+
/** Where the cursor is, and whether an armed placement would accept it. */
|
|
299
|
+
interface PointerAreaContext {
|
|
300
|
+
area: PointerTargetEntity;
|
|
301
|
+
position: Vec3Components;
|
|
302
|
+
normal: Vec3Components;
|
|
303
|
+
/** True when nothing is armed, or when the armed payload may land here. */
|
|
304
|
+
valid: boolean;
|
|
305
|
+
payload: unknown;
|
|
306
|
+
}
|
|
307
|
+
/** The pose a click would commit, including when it is not over an area. */
|
|
308
|
+
interface PlacementPointContext {
|
|
309
|
+
position: Vec3Components;
|
|
310
|
+
normal: Vec3Components;
|
|
311
|
+
area: PointerTargetEntity | null;
|
|
312
|
+
valid: boolean;
|
|
313
|
+
payload: unknown;
|
|
314
|
+
}
|
|
315
|
+
interface HoverAreaOptions {
|
|
316
|
+
onEnter?: (ctx: PointerAreaContext) => void;
|
|
317
|
+
onLeave?: (ctx: PointerAreaContext) => void;
|
|
318
|
+
onMove?: (ctx: PointerAreaContext) => void;
|
|
319
|
+
onClick?: (ctx: PointerAreaContext) => void;
|
|
320
|
+
}
|
|
321
|
+
interface DroppableAreaOptions extends HoverAreaOptions {
|
|
322
|
+
/** Omit to accept every payload. */
|
|
323
|
+
accepts?: (payload: unknown, area: PointerTargetEntity) => boolean;
|
|
324
|
+
/** Called after a placement commits on this area. Not a second spawn. */
|
|
325
|
+
onDrop?: (ctx: PlacementPointContext) => void;
|
|
326
|
+
/**
|
|
327
|
+
* `area` sits the preview on this area's center (a grid cell).
|
|
328
|
+
* `hit` keeps it on the ray's intersection with the area.
|
|
329
|
+
*/
|
|
330
|
+
placeAt?: 'area' | 'hit';
|
|
331
|
+
}
|
|
332
|
+
|
|
271
333
|
interface CollisionContext<T, O extends GameEntityOptions, TGlobals extends Record<string, unknown> = any> {
|
|
272
334
|
entity: T;
|
|
273
335
|
other: GameEntity<O | any>;
|
|
@@ -328,6 +390,11 @@ type GameEntityOptions = {
|
|
|
328
390
|
hideUntilPositioned?: boolean;
|
|
329
391
|
/** Explicit render visibility. When false, entity stays hidden until {@link GameEntity.reveal}. */
|
|
330
392
|
visible?: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* Level-mode object. Stays out of the entity list so the live stage cannot
|
|
395
|
+
* be written back over the level document.
|
|
396
|
+
*/
|
|
397
|
+
editorOwned?: boolean;
|
|
331
398
|
/** Render path: `environment` (bundle), `pack` (instanced), or `none` (default). */
|
|
332
399
|
category?: RenderCategory;
|
|
333
400
|
runtime?: RuntimeEntityOptions;
|
|
@@ -548,6 +615,18 @@ declare class GameEntity<O extends GameEntityOptions> extends BaseNode<O> implem
|
|
|
548
615
|
*/
|
|
549
616
|
onCollision(callback: (params: CollisionContext<this, O>) => void, options?: CollisionRegistrationOptions): this;
|
|
550
617
|
onCollision(...callbacks: ((params: CollisionContext<this, O>) => void)[]): this;
|
|
618
|
+
/**
|
|
619
|
+
* This entity is a pointer hotspot. The stage reports enter, leave, move,
|
|
620
|
+
* and click while the cursor ray is over its bounds. One pointer role per
|
|
621
|
+
* entity; a later {@link droppableArea} replaces this one.
|
|
622
|
+
*/
|
|
623
|
+
hoverArea(options?: HoverAreaOptions): this;
|
|
624
|
+
/**
|
|
625
|
+
* This entity accepts a placement drop. Includes the hover callbacks.
|
|
626
|
+
* `accepts` defaults to every payload. `onDrop` runs after a commit and
|
|
627
|
+
* does not spawn a second entity.
|
|
628
|
+
*/
|
|
629
|
+
droppableArea(options?: DroppableAreaOptions): this;
|
|
551
630
|
/**
|
|
552
631
|
* Use a behavior on this entity via typed descriptor.
|
|
553
632
|
* Behaviors will be auto-registered as systems when the entity is spawned.
|
|
@@ -675,4 +754,4 @@ declare class GameEntity<O extends GameEntityOptions> extends BaseNode<O> implem
|
|
|
675
754
|
*/
|
|
676
755
|
declare function create(options?: Partial<GameEntityOptions>): GameEntity<GameEntityOptions>;
|
|
677
756
|
|
|
678
|
-
export { type Action as A,
|
|
757
|
+
export { type Action as A, getRotation as B, type CollisionComponent as C, type DroppableAreaOptions as D, GameEntityLifeCycle as E, EntityBuilder as F, GameEntity as G, type HoverAreaOptions as H, EntityMeshBuilder as I, EntityCollisionBuilder as J, type PointerAreaContext as P, type PlacementPointContext as a, type PointerTargetEntity as b, create as c, type GameEntityOptions as d, boxCollision as e, coneCollision as f, cylinderCollision as g, pillCollision as h, planeCollision as i, rotateYEuler as j, rotateEuler as k, rotateX as l, rotateY as m, rotateZ as n, setRotationY as o, pyramidCollision as p, setRotationX as q, rotateInDirection as r, sphereCollision as s, setRotationZ as t, setRotationDegrees as u, setRotationDegreesY as v, setRotationDegreesX as w, setRotationDegreesZ as x, setRotation as y, zoneCollision as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Vector3, Sprite, Texture, Color, Box3, Object3D, ColorRepresentation, Light, Fog, FogExp2, Scene, Raycaster } from 'three';
|
|
2
2
|
import { B as BaseNode } from './base-node-idopiSw5.js';
|
|
3
|
-
import { G as GameEntity,
|
|
3
|
+
import { G as GameEntity, d as GameEntityOptions } from './entity-CY75JJSw.js';
|
|
4
4
|
import { d as Vec3Components, e as Vec3Input, b as Vec2Input } from './vector-D3eDzvcA.js';
|
|
5
5
|
import { U as UpdateContext, a as SetupContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
|
|
6
|
-
import { T as TexturePath,
|
|
6
|
+
import { T as TexturePath, g as MaterialOptions } from './material-D1IVeQc5.js';
|
|
7
7
|
import { d as SelectionBoundsProvider } from './selection-bounds-BKmSo9aG.js';
|
|
8
8
|
import { Simulation } from '@zylem/behaviors/core';
|
|
9
9
|
import { E as Entity } from './entity-BIf_a4dl.js';
|
|
@@ -185,6 +185,23 @@ declare class ZylemSphere extends GameEntity<ZylemSphereOptions> {
|
|
|
185
185
|
type SphereOptions = BaseNode | Partial<ZylemSphereOptions>;
|
|
186
186
|
declare function createSphere(...args: Array<SphereOptions>): ZylemSphere;
|
|
187
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Viewport placement shared by the camera-attached HUD entities.
|
|
190
|
+
*
|
|
191
|
+
* Text, rects, and cooldown icons all pin a canvas-drawn sprite to a point on
|
|
192
|
+
* screen by parenting it to the camera and placing it on a plane `zDistance`
|
|
193
|
+
* in front of the lens. This module holds what they share: the named viewport
|
|
194
|
+
* anchors, the viewport size layouts resolve against, and the camera-local
|
|
195
|
+
* transform for a box of a given pixel size pinned to a point on screen.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Reference point on the viewport for positioning UI elements.
|
|
200
|
+
* The offset in `screenPosition` is applied relative to this anchor.
|
|
201
|
+
*/
|
|
202
|
+
type ScreenAnchor = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
203
|
+
|
|
204
|
+
type RectShape = 'rect' | 'ellipse';
|
|
188
205
|
type ZylemRectOptions = GameEntityOptions & {
|
|
189
206
|
width?: number;
|
|
190
207
|
height?: number;
|
|
@@ -193,9 +210,23 @@ type ZylemRectOptions = GameEntityOptions & {
|
|
|
193
210
|
strokeWidth?: number;
|
|
194
211
|
radius?: number;
|
|
195
212
|
padding?: number;
|
|
213
|
+
/** `ellipse` inscribes an ellipse in the width × height box and ignores `radius`. */
|
|
214
|
+
shape?: RectShape;
|
|
215
|
+
/** Image URL drawn over the fill, stretched to the box and clipped to the shape. */
|
|
216
|
+
image?: string | null;
|
|
196
217
|
stickToViewport?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Viewport point the rect is positioned from. When set, `screenPosition` is
|
|
220
|
+
* a pixel offset from it (+x right, +y down) and `anchor` defaults to the
|
|
221
|
+
* same point, so a `bottom-right` rect sits inside that corner.
|
|
222
|
+
*/
|
|
223
|
+
screenAnchor?: ScreenAnchor;
|
|
197
224
|
screenPosition?: Vec2Input;
|
|
198
225
|
zDistance?: number;
|
|
226
|
+
/**
|
|
227
|
+
* Point of the rect placed on its screen position, 0-100 per axis. Defaults
|
|
228
|
+
* to the `screenAnchor` point when one is set, otherwise top-left (0,0).
|
|
229
|
+
*/
|
|
199
230
|
anchor?: Vec2Input;
|
|
200
231
|
bounds?: {
|
|
201
232
|
screen?: {
|
|
@@ -224,25 +255,27 @@ declare class ZylemRect extends GameEntity<ZylemRectOptions> {
|
|
|
224
255
|
private _cameraRef;
|
|
225
256
|
private _lastCanvasW;
|
|
226
257
|
private _lastCanvasH;
|
|
258
|
+
private _image;
|
|
259
|
+
private _imageSource;
|
|
227
260
|
constructor(options?: ZylemRectOptions);
|
|
228
261
|
private createSprite;
|
|
262
|
+
/** Starts loading `options.image` when it differs from what is drawn. */
|
|
263
|
+
private loadImage;
|
|
229
264
|
private redrawRect;
|
|
230
265
|
getWidth(): number;
|
|
231
266
|
getHeight(): number;
|
|
232
267
|
private roundedRectPath;
|
|
233
268
|
private toCssColor;
|
|
234
|
-
/**
|
|
235
|
-
* Get the viewport resolution from the renderer DOM element,
|
|
236
|
-
* falling back to the camera's screenResolution if the renderer
|
|
237
|
-
* is not available (e.g. when using the new RendererManager path).
|
|
238
|
-
*/
|
|
239
|
-
private getResolution;
|
|
240
269
|
private rectSetup;
|
|
241
270
|
private rectUpdate;
|
|
271
|
+
/** Where the rect's anchor goes on screen, in pixels from the top-left. */
|
|
272
|
+
private screenPoint;
|
|
273
|
+
/** Point of the rect placed on its screen position, as 0..1 fractions of its box. */
|
|
274
|
+
private pivot;
|
|
242
275
|
private updateStickyTransform;
|
|
243
276
|
private worldToScreen;
|
|
244
277
|
private computeScreenBoundsFromOptions;
|
|
245
|
-
updateRect(options?: Partial<Pick<ZylemRectOptions, 'width' | 'height' | 'fillColor' | 'strokeColor' | 'strokeWidth' | 'radius'>>): void;
|
|
278
|
+
updateRect(options?: Partial<Pick<ZylemRectOptions, 'width' | 'height' | 'fillColor' | 'strokeColor' | 'strokeWidth' | 'radius' | 'shape' | 'image'>>): void;
|
|
246
279
|
buildInfo(): Record<string, any>;
|
|
247
280
|
}
|
|
248
281
|
type RectOptions = BaseNode | Partial<ZylemRectOptions>;
|
|
@@ -256,6 +289,14 @@ type ZylemTextOptions = GameEntityOptions & {
|
|
|
256
289
|
backgroundColor?: Color | string | null;
|
|
257
290
|
padding?: number;
|
|
258
291
|
stickToViewport?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Viewport point the text is positioned from. When set, `screenPosition` is
|
|
294
|
+
* a pixel offset from it (+x right, +y down) and the text aligns to the same
|
|
295
|
+
* point, so `top-right` text ends at that corner. Without it,
|
|
296
|
+
* `screenPosition` is the text's centre, in pixels or as 0..1 fractions of
|
|
297
|
+
* the viewport.
|
|
298
|
+
*/
|
|
299
|
+
screenAnchor?: ScreenAnchor;
|
|
259
300
|
screenPosition?: Vec2Input;
|
|
260
301
|
zDistance?: number;
|
|
261
302
|
};
|
|
@@ -279,10 +320,8 @@ declare class ZylemText extends GameEntity<ZylemTextOptions> {
|
|
|
279
320
|
private toCssColor;
|
|
280
321
|
private textSetup;
|
|
281
322
|
private textUpdate;
|
|
282
|
-
|
|
283
|
-
private
|
|
284
|
-
private computeWorldExtents;
|
|
285
|
-
private updateSpriteScale;
|
|
323
|
+
/** Where the text's pivot goes on screen, in pixels from the top-left. */
|
|
324
|
+
private screenPoint;
|
|
286
325
|
private updateWorldSpriteScale;
|
|
287
326
|
private updateStickyTransform;
|
|
288
327
|
updateText(_text: string): void;
|
|
@@ -969,4 +1008,4 @@ interface EntityTypeMap {
|
|
|
969
1008
|
*/
|
|
970
1009
|
type EntityForType<T> = T extends keyof EntityTypeMap ? EntityTypeMap[T] : BaseNode;
|
|
971
1010
|
|
|
972
|
-
export {
|
|
1011
|
+
export { LIGHT_TYPE as $, ACTOR_TYPE as A, BOX_TYPE as B, type CollisionShapeType as C, DISK_TYPE as D, ZylemCone as E, CONE_TYPE as F, createPyramid as G, ZylemPyramid as H, PYRAMID_TYPE as I, createCylinder as J, ZylemCylinder as K, CYLINDER_TYPE as L, createPill as M, ZylemPill as N, type OnHeldParams as O, PLANE_TYPE as P, PILL_TYPE as Q, RECT_TYPE as R, SPHERE_TYPE as S, TEXT_TYPE as T, createParticleSystem as U, ZylemParticleSystem as V, PARTICLE_SYSTEM_TYPE as W, type ZylemParticleSystemOptions as X, createLight as Y, ZylemBox as Z, ZylemLight as _, createSphere as a, type ZylemLightOptions as a0, type AmbientLightOptions as a1, type HemisphereLightOptions as a2, type DirectionalLightOptions as a3, type PointLightOptions as a4, type SpotLightOptions as a5, type LightShadowOptions as a6, createFog as a7, ZylemFog as a8, FOG_TYPE as a9, createLine as aa, ZylemLine as ab, LINE_TYPE as ac, pickZylemLine as ad, type ZylemLineOptions as ae, type LinePickResult as af, type ZylemFogOptions as ag, type ZylemFogType as ah, type ZylemFogHeightOptions as ai, type ZylemFogNoiseOptions as aj, type ScreenAnchor as ak, type EntityTypeMap as al, type EntityForType as am, ZylemWorld as an, ZylemSphere as b, createBox as c, createSprite as d, ZylemSprite as e, SPRITE_TYPE as f, type SpriteImage as g, type SpriteAnimation as h, type SpriteSheet as i, createPlane as j, ZylemPlane as k, createZone as l, ZylemZone as m, ZONE_TYPE as n, type OnEnterParams as o, type OnExitParams as p, createActor as q, ZylemActor as r, createText as s, ZylemText as t, createRect as u, ZylemRect as v, type RectShape as w, createDisk as x, ZylemDisk as y, createCone as z };
|
package/dist/entity.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ak as ScreenAnchor } from './entity-type-map-BMaPY8cd.js';
|
|
2
|
+
export { A as ACTOR_TYPE, a1 as AmbientLightOptions, B as BOX_TYPE, F as CONE_TYPE, L as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a3 as DirectionalLightOptions, am as EntityForType, al as EntityTypeMap, a9 as FOG_TYPE, a2 as HemisphereLightOptions, $ as LIGHT_TYPE, ac as LINE_TYPE, a6 as LightShadowOptions, af as LinePickResult, o as OnEnterParams, p as OnExitParams, O as OnHeldParams, W as PARTICLE_SYSTEM_TYPE, Q as PILL_TYPE, P as PLANE_TYPE, I as PYRAMID_TYPE, a4 as PointLightOptions, R as RECT_TYPE, w as RectShape, S as SPHERE_TYPE, f as SPRITE_TYPE, a5 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, i as SpriteSheet, T as TEXT_TYPE, n as ZONE_TYPE, r as ZylemActor, Z as ZylemBox, E as ZylemCone, K as ZylemCylinder, y as ZylemDisk, a8 as ZylemFog, ai as ZylemFogHeightOptions, aj as ZylemFogNoiseOptions, ag as ZylemFogOptions, ah as ZylemFogType, _ as ZylemLight, a0 as ZylemLightOptions, ab as ZylemLine, ae as ZylemLineOptions, V as ZylemParticleSystem, X as ZylemParticleSystemOptions, N as ZylemPill, k as ZylemPlane, H as ZylemPyramid, v as ZylemRect, b as ZylemSphere, e as ZylemSprite, t as ZylemText, m as ZylemZone, q as createActor, c as createBox, z as createCone, J as createCylinder, x as createDisk, a7 as createFog, Y as createLight, aa as createLine, U as createParticleSystem, M as createPill, j as createPlane, G as createPyramid, u as createRect, a as createSphere, d as createSprite, s as createText, l as createZone, ad as pickZylemLine } from './entity-type-map-BMaPY8cd.js';
|
|
3
|
+
import { G as GameEntity, d as GameEntityOptions, F as EntityBuilder, I as EntityMeshBuilder, J as EntityCollisionBuilder } from './entity-CY75JJSw.js';
|
|
4
|
+
export { C as CollisionComponent, e as boxCollision, f as coneCollision, c as create, g as cylinderCollision, h as pillCollision, i as planeCollision, p as pyramidCollision, s as sphereCollision, z as zoneCollision } from './entity-CY75JJSw.js';
|
|
4
5
|
import { Color, Mesh } from 'three';
|
|
5
6
|
import { B as BaseNode } from './base-node-idopiSw5.js';
|
|
6
7
|
import { b as Vec2Input, e as Vec3Input } from './vector-D3eDzvcA.js';
|
|
7
|
-
import {
|
|
8
|
+
import { g as MaterialOptions } from './material-D1IVeQc5.js';
|
|
8
9
|
import './base-node-life-cycle-BK9xebT9.js';
|
|
9
10
|
import './stage-transition-CmGpV4tc.js';
|
|
10
11
|
import './selection-bounds-BKmSo9aG.js';
|
|
@@ -75,11 +76,6 @@ declare function createEntityFactory<E extends GameEntity<O>, O extends GameEnti
|
|
|
75
76
|
* Modeled after ZylemRect's canvas-based viewport-attached sprite pattern.
|
|
76
77
|
*/
|
|
77
78
|
|
|
78
|
-
/**
|
|
79
|
-
* Reference point on the viewport for positioning UI elements.
|
|
80
|
-
* The offset in `screenPosition` is applied relative to this anchor.
|
|
81
|
-
*/
|
|
82
|
-
type ScreenAnchor = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
83
79
|
/** Preset icon sizes in view units. */
|
|
84
80
|
declare const ICON_SIZE_PRESETS: {
|
|
85
81
|
readonly xs: 8;
|
|
@@ -152,21 +148,13 @@ declare class ZylemCooldownIcon extends GameEntity<ZylemCooldownIconOptions> {
|
|
|
152
148
|
private createSprite;
|
|
153
149
|
private redraw;
|
|
154
150
|
private toCssColor;
|
|
155
|
-
private getResolution;
|
|
156
151
|
private iconSetup;
|
|
157
152
|
private iconUpdate;
|
|
158
|
-
/**
|
|
159
|
-
* Resolve screen position to pixels.
|
|
160
|
-
* Computes the anchor point in pixels, then adds the view-unit offset.
|
|
161
|
-
*/
|
|
162
|
-
private resolveScreenPosition;
|
|
163
153
|
/**
|
|
164
154
|
* Resolve `iconSize` to screen pixels using the view-unit grid.
|
|
165
155
|
* Viewport height = {@link VIEW_UNITS_HEIGHT} units; width scales with aspect ratio.
|
|
166
156
|
*/
|
|
167
157
|
private resolveIconSize;
|
|
168
|
-
/** Compute the world-space half-extents at a given distance from the camera. */
|
|
169
|
-
private computeWorldExtents;
|
|
170
158
|
private updateStickyTransform;
|
|
171
159
|
/**
|
|
172
160
|
* Dispose Three.js / DOM resources when the entity is destroyed.
|
|
@@ -270,4 +258,4 @@ interface PillMeshOptions extends BaseMeshOptions {
|
|
|
270
258
|
*/
|
|
271
259
|
declare function pillMesh(opts?: PillMeshOptions): Mesh;
|
|
272
260
|
|
|
273
|
-
export { GameEntity, GameEntityOptions, type IconSize, type IconSizePreset,
|
|
261
|
+
export { GameEntity, GameEntityOptions, type IconSize, type IconSizePreset, ScreenAnchor, type TemplateFactory, boxMesh, coneMesh, createCooldownIcon, createEntity, createEntityFactory, cylinderMesh, destroy, pillMesh, pyramidMesh, sphereMesh };
|
package/dist/entity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ma,b as na,c as oa,d as pa,e as qa}from"./chunk-
|
|
1
|
+
import{a as ma,b as na,c as oa,d as pa,e as qa}from"./chunk-CVKEWWIH.js";import{a as ba,b as ca,c as da,d as ea,e as fa,f as ga,g as ha,h as ia,i as ja,j as ka,l as la}from"./chunk-63T3K5EQ.js";import{a as X,b as Y,c as Z,d as _,e as $,f as aa}from"./chunk-M2FZ224T.js";import{A as J,B as K,C as L,D as M,E as N,J as R,K as S,L as T,M as U,N as V,O as W,b as j,c as k,d as l,e as m,f as n,g as o,h as p,i as q,j as r,k as s,l as t,m as u,n as v,o as w,p as x,q as y,r as z,s as A,t as B,u as C,v as D,w as E,x as F,y as G,z as I}from"./chunk-DYD7MDWO.js";import{d as H,e as O,f as P,g as Q}from"./chunk-IHGRFR4H.js";import{E as i,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h}from"./chunk-AJSIVGDX.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-Q22Z4PBD.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-UUOPT2N4.js";import"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";import"./chunk-WOT6VMZA.js";export{X as ACTOR_TYPE,p as BOX_TYPE,v as CONE_TYPE,B as CYLINDER_TYPE,I as DISK_TYPE,_ as FOG_TYPE,U as LIGHT_TYPE,ha as LINE_TYPE,ma as PARTICLE_SYSTEM_TYPE,E as PILL_TYPE,L as PLANE_TYPE,y as PYRAMID_TYPE,R as RECT_TYPE,s as SPHERE_TYPE,ea as SPRITE_TYPE,ba as TEXT_TYPE,O as ZONE_TYPE,Y as ZylemActor,q as ZylemBox,w as ZylemCone,C as ZylemCylinder,J as ZylemDisk,$ as ZylemFog,V as ZylemLight,ja as ZylemLine,na as ZylemParticleSystem,F as ZylemPill,M as ZylemPlane,z as ZylemPyramid,S as ZylemRect,t as ZylemSphere,fa as ZylemSprite,ca as ZylemText,P as ZylemZone,a as boxCollision,j as boxMesh,c as coneCollision,l as coneMesh,i as create,Z as createActor,r as createBox,x as createCone,pa as createCooldownIcon,D as createCylinder,K as createDisk,H as createEntity,la as createEntityFactory,aa as createFog,W as createLight,ka as createLine,oa as createParticleSystem,G as createPill,N as createPlane,A as createPyramid,T as createRect,u as createSphere,ga as createSprite,da as createText,Q as createZone,e as cylinderCollision,n as cylinderMesh,qa as destroy,ia as pickZylemLine,f as pillCollision,o as pillMesh,g as planeCollision,d as pyramidCollision,m as pyramidMesh,b as sphereCollision,k as sphereMesh,h as zoneCollision};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { e as InputPlayerNumber, f as InputProvider, I as Inputs, a as SetupContext, U as UpdateContext, D as DestroyContext, m as IGame, h as SetupFunction, g as UpdateFunction, j as DestroyFunction, S as StageNavigationOptions } from './base-node-life-cycle-BK9xebT9.js';
|
|
2
2
|
import { G as GameInputConfig, B as BaseGlobals, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
|
|
3
3
|
import { B as BaseNode } from './base-node-idopiSw5.js';
|
|
4
|
-
import { B as BaseEntityInterface, q as Stage } from './stage-
|
|
5
|
-
import {
|
|
4
|
+
import { B as BaseEntityInterface, q as Stage } from './stage-CCGJh9TD.js';
|
|
5
|
+
import { E as GameEntityLifeCycle } from './entity-CY75JJSw.js';
|
|
6
6
|
import { Color, Vector3 } from 'three';
|
|
7
7
|
import { d as Vec3Components } from './vector-D3eDzvcA.js';
|
|
8
8
|
import { D as DefaultTouchControlsOptions } from './default-controls-CAKJ5zlo.js';
|
|
9
9
|
import { GameEvents } from './events.js';
|
|
10
10
|
import { Simulation } from '@zylem/behaviors/core';
|
|
11
|
-
import { l as ZylemCamera, R as RendererManager } from './zylem-camera-
|
|
11
|
+
import { l as ZylemCamera, R as RendererManager } from './zylem-camera-BA3VPFlS.js';
|
|
12
12
|
import { S as StageTransitionConfig } from './stage-transition-CmGpV4tc.js';
|
|
13
13
|
|
|
14
14
|
declare class InputManager {
|
|
@@ -126,6 +126,11 @@ declare class Timer {
|
|
|
126
126
|
update(timestamp?: number): Timer;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
interface ViewportSize {
|
|
130
|
+
width: number;
|
|
131
|
+
height: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
129
134
|
/**
|
|
130
135
|
* Stage state interface - minimal to prevent circular dependencies
|
|
131
136
|
*/
|
|
@@ -190,11 +195,6 @@ declare class AspectRatioDelegate {
|
|
|
190
195
|
apply(): void;
|
|
191
196
|
}
|
|
192
197
|
|
|
193
|
-
interface ViewportSize {
|
|
194
|
-
width: number;
|
|
195
|
-
height: number;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
198
|
type RetroResolution = {
|
|
199
199
|
key: string;
|
|
200
200
|
width: number;
|