@zylem/game-lib 0.9.6 → 0.9.8
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 +99183 -42019
- package/dist/api/game-lib.api.md +3822 -706
- package/dist/api/game-lib.d.ts +8703 -784
- package/dist/api/game-lib.typedoc.json +336362 -193038
- package/dist/audio.js +1 -1
- 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 +16 -4
- package/dist/bridge.js +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/chunk-26EJFYDX.js +1 -0
- package/dist/chunk-2NO4YCLR.js +1 -0
- package/dist/chunk-3LXDHDJB.js +1 -0
- package/dist/chunk-4DAITCJS.js +1 -0
- package/dist/{chunk-Y23IJJPD.js → chunk-5NQGXW75.js} +1 -1
- package/dist/chunk-5WRFDAZN.js +1 -0
- package/dist/{chunk-OCQ7A5IK.js → chunk-B6GDESCB.js} +1 -1
- package/dist/chunk-BIZOIGCZ.js +1 -0
- package/dist/chunk-BJYXY2FB.js +1 -0
- package/dist/chunk-CI7A5N6G.js +1 -0
- package/dist/chunk-GQXYD2JG.js +1 -0
- package/dist/{chunk-KIFB427K.js → chunk-ICJ2E2OV.js} +1 -1
- package/dist/chunk-NPA6GUGE.js +24 -0
- package/dist/chunk-SIRFF4DY.js +1 -0
- package/dist/chunk-T6O2SGH5.js +1 -0
- package/dist/chunk-UNCP6V7I.js +1 -0
- package/dist/chunk-Y5IU6IA5.js +1 -0
- package/dist/chunk-YFXNZ2RS.js +1 -0
- package/dist/chunk-YW2GTHCV.js +19 -0
- package/dist/chunk-YWH5HQDT.js +1 -0
- package/dist/cinematics.d.ts +7 -6
- package/dist/core.d.ts +20 -17
- package/dist/core.js +1 -1
- package/dist/{debug-state-DhVkY2aM.d.ts → debug-state-JRneI6c2.d.ts} +2 -2
- package/dist/debug.d.ts +28 -126
- package/dist/debug.js +1 -1
- package/dist/{entity-DC0P747T.d.ts → entity-CY75JJSw.d.ts} +78 -4
- package/dist/{entity-type-map-B0S5cfv7.d.ts → entity-type-map-BMaPY8cd.d.ts} +2 -2
- package/dist/entity.d.ts +5 -5
- package/dist/entity.js +1 -1
- package/dist/fbx-loader-SDI6QYTS.js +1 -0
- package/dist/game-default-AF5QFXSD.js +1 -0
- package/dist/{game-mu6OSCrq.d.ts → game-uQd7k6-m.d.ts} +3 -3
- package/dist/gaussian-splat-loader-ACFJKCCL.js +1 -0
- package/dist/geometry-mesh-loader-XDJV77TU.js +1 -0
- package/dist/graphics.d.ts +3 -3
- package/dist/graphics.js +1 -1
- package/dist/{material-CxxAyJYp.d.ts → material-D1IVeQc5.d.ts} +48 -2
- package/dist/obj-loader-SI5RVY24.js +1 -0
- 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 +12 -10
- package/dist/public.js +1 -1
- package/dist/sog-loader-BZFMQ3ZB.js +1 -0
- package/dist/{stage-B_KdSEK6.d.ts → stage-Dez16Gxm.d.ts} +186 -16
- package/dist/transform-gizmo-DappLQ9w.d.ts +123 -0
- package/dist/usd-loader-PCBATNPM.js +1 -0
- package/dist/web-components.d.ts +9 -8
- package/dist/{zylem-camera-CWhIGXlW.d.ts → zylem-camera-BA3VPFlS.d.ts} +9 -0
- package/package.json +150 -7
- package/dist/chunk-47HAZZWF.js +0 -1
- package/dist/chunk-5V52N34T.js +0 -1
- package/dist/chunk-6FGXC4T6.js +0 -19
- package/dist/chunk-FUZDTRCU.js +0 -1
- package/dist/chunk-P6IOYQHU.js +0 -1
- package/dist/chunk-QB3NL7VQ.js +0 -1
- package/dist/chunk-RPMV7GDX.js +0 -24
- package/dist/chunk-VKWJHFUR.js +0 -1
- package/dist/chunk-VXE3CV3K.js +0 -1
- package/dist/chunk-YRHRMVHS.js +0 -1
- package/dist/game-default-VUMUMTXA.js +0 -1
- package/dist/level-types-D10LiOcn.d.ts +0 -91
package/dist/core.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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-uQd7k6-m.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-uQd7k6-m.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-
|
|
6
|
-
import { LevelBuffer, LevelEntry } from '@zylem/bridge';
|
|
7
|
-
export { LevelBuffer } from '@zylem/bridge';
|
|
4
|
+
import { q as Stage, C as CameraWrapper } from './stage-Dez16Gxm.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-Dez16Gxm.js';
|
|
6
|
+
import { LevelBuffer, LevelEntry, LevelDocument } from '@zylem/bridge';
|
|
7
|
+
export { LevelBuffer, LevelDocument } 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';
|
|
10
9
|
import { Vector2 } from 'three';
|
|
11
|
-
import { G as GameEntity,
|
|
10
|
+
import { G as GameEntity, d as GameEntityOptions } from './entity-CY75JJSw.js';
|
|
11
|
+
export { A as ArmPlacementOptions, P as PlacementSession } from './placement-session-BNQoL7Jb.js';
|
|
12
12
|
import { S as StageBlueprint } from './blueprints-TbGY-h53.js';
|
|
13
13
|
import { a as SetupContext, k as LoadedContext, U as UpdateContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
|
|
14
14
|
export { L as LoadingEvent, S as StageNavigationOptions } from './base-node-life-cycle-BK9xebT9.js';
|
|
15
15
|
export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
|
|
16
|
-
import { f as CameraBehavior } from './zylem-camera-
|
|
17
|
-
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-
|
|
16
|
+
import { f as CameraBehavior } from './zylem-camera-BA3VPFlS.js';
|
|
17
|
+
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';
|
|
18
18
|
import { e as Vec3Input, c as Vec3 } from './vector-D3eDzvcA.js';
|
|
19
19
|
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';
|
|
20
20
|
import { S as StageEntity } from './entity-BIf_a4dl.js';
|
|
@@ -22,13 +22,14 @@ import './default-controls-CAKJ5zlo.js';
|
|
|
22
22
|
import './events.js';
|
|
23
23
|
import 'mitt';
|
|
24
24
|
import '@zylem/behaviors/core';
|
|
25
|
-
import './entity-type-map-
|
|
26
|
-
import './material-
|
|
25
|
+
import './entity-type-map-BMaPY8cd.js';
|
|
26
|
+
import './material-D1IVeQc5.js';
|
|
27
27
|
import 'three/webgpu';
|
|
28
28
|
import './selection-bounds-BKmSo9aG.js';
|
|
29
29
|
import '@zylem/behaviors/particle-emitter';
|
|
30
30
|
import 'three/addons/lines/webgpu/Line2.js';
|
|
31
31
|
import './simulation-body-zQw-emOr.js';
|
|
32
|
+
import './transform-gizmo-DappLQ9w.js';
|
|
32
33
|
import './collision-builder-BckxkdmA.js';
|
|
33
34
|
import '@sinclair/typebox';
|
|
34
35
|
|
|
@@ -82,10 +83,12 @@ declare function streamLevelOnStage(stage: LevelStage, buffer: LevelBuffer, opti
|
|
|
82
83
|
/**
|
|
83
84
|
* The stage's picture of the level document.
|
|
84
85
|
*
|
|
85
|
-
* The editor owns the file. This session draws it,
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* The editor owns the file. This session draws it, routes level pointer
|
|
87
|
+
* gestures to the tools, reports what they finish, and on play swaps the
|
|
88
|
+
* brush faces for one merged mesh and one static body of convex hulls per
|
|
89
|
+
* sector. Nothing it creates is a normal stage entity except play-mode
|
|
90
|
+
* trigger zones, and those are marked editor-owned so they are not published
|
|
91
|
+
* back.
|
|
89
92
|
*/
|
|
90
93
|
|
|
91
94
|
/** The document currently previewed or playing, for hosts that spawn from markers. */
|
|
@@ -399,4 +402,4 @@ declare function isManagedRenderEntity(entity: {
|
|
|
399
402
|
*/
|
|
400
403
|
type Vect3 = Vec3;
|
|
401
404
|
|
|
402
|
-
export { CameraBehavior, type CameraFeedOptions, CameraWrapper, type FollowTargetOptions,
|
|
405
|
+
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, 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 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-
|
|
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-NPA6GUGE.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-BIZOIGCZ.js";import{e as g}from"./chunk-26EJFYDX.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-PCFF4LLO.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-B6GDESCB.js";import"./chunk-SIRFF4DY.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-ICJ2E2OV.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-3LXDHDJB.js";import"./chunk-BJYXY2FB.js";import"./chunk-YWH5HQDT.js";import"./chunk-UNCP6V7I.js";import"./chunk-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.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' | 'brush' | 'clip' | '
|
|
3
|
+
type DebugTools = 'select' | 'translate' | 'rotate' | 'scale' | 'delete' | 'add' | 'brush' | 'clip' | 'shear' | '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-JRneI6c2.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,133 +15,26 @@ 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
18
|
/**
|
|
39
|
-
*
|
|
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
|
-
/**
|
|
138
|
-
* The y=0 construction plane, drawn so the snap lattice is legible.
|
|
19
|
+
* The construction plane, drawn so the snap lattice is legible. It lies on
|
|
20
|
+
* y=0 unless a level draw lays it on the draw plane.
|
|
139
21
|
*
|
|
140
22
|
* Two overlaid grids: fine lines at the translation snap increment, and heavier
|
|
141
23
|
* lines every metre. Without the coarse pass a 0.25 grid over any useful area
|
|
142
24
|
* reads as flat grey noise.
|
|
143
25
|
*/
|
|
144
26
|
|
|
27
|
+
interface GridPoint {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
z: number;
|
|
31
|
+
}
|
|
32
|
+
/** A plane as a draw frame names it: a point on it, its in-plane `u`, and its normal. */
|
|
33
|
+
interface GridPlane {
|
|
34
|
+
origin: GridPoint;
|
|
35
|
+
u: GridPoint;
|
|
36
|
+
normal: GridPoint;
|
|
37
|
+
}
|
|
145
38
|
declare class ConstructionGrid {
|
|
146
39
|
private group;
|
|
147
40
|
private scene;
|
|
@@ -154,8 +47,17 @@ declare class ConstructionGrid {
|
|
|
154
47
|
setIncrement(increment: number): void;
|
|
155
48
|
setVisible(visible: boolean): void;
|
|
156
49
|
get visible(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Lay the grid on a plane, or back on y=0 with `null`.
|
|
52
|
+
*
|
|
53
|
+
* The plane's `u` runs along the grid's X. The grid centres on the lines
|
|
54
|
+
* nearest `focus`, shifted by whole cells, so it stays on the world lattice.
|
|
55
|
+
*/
|
|
56
|
+
setPlane(plane: GridPlane | null, focus?: GridPoint): void;
|
|
157
57
|
dispose(): void;
|
|
158
58
|
private rebuild;
|
|
59
|
+
/** The shortest shift that is whole fine steps and whole metres, so neither set of lines moves. */
|
|
60
|
+
private wholeCell;
|
|
159
61
|
private clearHelpers;
|
|
160
62
|
}
|
|
161
63
|
|
|
@@ -287,4 +189,4 @@ declare class EntityThumbnailCache {
|
|
|
287
189
|
/** Shared cache used by the running game to feed editor entity payloads. */
|
|
288
190
|
declare const entityThumbnailCache: EntityThumbnailCache;
|
|
289
191
|
|
|
290
|
-
export { ConstructionGrid, type EntityFocusContext, EntityThumbnailCache, type EntityThumbnailCacheEntry, type EntityThumbnailResult, type
|
|
192
|
+
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-
|
|
1
|
+
import"./chunk-ELQN62PQ.js";import{a as x,b as y}from"./chunk-B6GDESCB.js";import{c as P,d as Q,e as R,f as S}from"./chunk-SIRFF4DY.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{S 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,R as TransformGizmo,P 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,Q 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>;
|
|
@@ -553,6 +615,18 @@ declare class GameEntity<O extends GameEntityOptions> extends BaseNode<O> implem
|
|
|
553
615
|
*/
|
|
554
616
|
onCollision(callback: (params: CollisionContext<this, O>) => void, options?: CollisionRegistrationOptions): this;
|
|
555
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;
|
|
556
630
|
/**
|
|
557
631
|
* Use a behavior on this entity via typed descriptor.
|
|
558
632
|
* Behaviors will be auto-registered as systems when the entity is spawned.
|
|
@@ -680,4 +754,4 @@ declare class GameEntity<O extends GameEntityOptions> extends BaseNode<O> implem
|
|
|
680
754
|
*/
|
|
681
755
|
declare function create(options?: Partial<GameEntityOptions>): GameEntity<GameEntityOptions>;
|
|
682
756
|
|
|
683
|
-
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';
|
package/dist/entity.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ak as ScreenAnchor } from './entity-type-map-
|
|
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-
|
|
3
|
-
import { G as GameEntity,
|
|
4
|
-
export { C as CollisionComponent,
|
|
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';
|
|
5
5
|
import { Color, Mesh } from 'three';
|
|
6
6
|
import { B as BaseNode } from './base-node-idopiSw5.js';
|
|
7
7
|
import { b as Vec2Input, e as Vec3Input } from './vector-D3eDzvcA.js';
|
|
8
|
-
import {
|
|
8
|
+
import { g as MaterialOptions } from './material-D1IVeQc5.js';
|
|
9
9
|
import './base-node-life-cycle-BK9xebT9.js';
|
|
10
10
|
import './stage-transition-CmGpV4tc.js';
|
|
11
11
|
import './selection-bounds-BKmSo9aG.js';
|
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-5NQGXW75.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-3LXDHDJB.js";import{a as X,b as Y,c as Z,d as _,e as $,f as aa}from"./chunk-BJYXY2FB.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-YWH5HQDT.js";import{d as H,e as O,f as P,g as Q}from"./chunk-UNCP6V7I.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-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,k as i}from"./chunk-T6O2SGH5.js";import"./chunk-WOT6VMZA.js";import{FBXLoader as c}from"three/addons/loaders/FBXLoader.js";function l(r,o){if(!o?.applyUnitScale)return;let e=r.userData?.unitScaleFactor;typeof e!="number"||!Number.isFinite(e)||e===1||r.scale.multiplyScalar(e)}var d=class{loader;constructor(){this.loader=new c}isSupported(o){return i(o)==="fbx"}async load(o,e){return e?.useAsyncFetch?this.loadWithAsyncFetch(o,e):this.loadMainThread(o,e)}async loadWithAsyncFetch(o,e){try{let a=await fetch(o);if(!a.ok)throw new Error(`Failed to fetch ${o}: ${a.status} ${a.statusText}`);let n=await a.arrayBuffer(),t=this.loader.parse(n,o);return l(t,e),{object:t,animations:t.animations||[]}}catch(a){return console.error(`Async fetch FBX load failed for ${o}, falling back to loader.load():`,a),this.loadMainThread(o,e)}}async loadMainThread(o,e){return new Promise((a,n)=>{this.loader.load(o,t=>{l(t,e),a({object:t,animations:t.animations||[]})},t=>{e?.onProgress&&t.lengthComputable&&e.onProgress(t.loaded/t.total)},t=>n(t))})}clone(o){return{object:s(o.object),animations:o.animations?.map(e=>e.clone())}}};export{d as FBXLoaderAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"./chunk-BIZOIGCZ.js";import"./chunk-26EJFYDX.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-SIRFF4DY.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-2HSR5XDQ.js";import"./chunk-D2PATZCC.js";import"./chunk-BJYXY2FB.js";import"./chunk-UNCP6V7I.js";import"./chunk-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.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";import{proxy as t}from"valtio/vanilla";var s=()=>({id:"zylem",globals:{},stages:[e()],debug:!1,time:0,input:void 0}),a=t({...s()});function o(){return{id:a.id??"zylem",globals:a.globals??{},stages:a.stages??[e()],debug:a.debug,time:a.time,input:a.input}}export{o as getGameDefaultConfig};
|
|
@@ -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-Dez16Gxm.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 {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"./chunk-GQXYD2JG.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import"./chunk-WOT6VMZA.js";export{c as GaussianSplatAdapter,a as createGaussianSplatResult,b as parseGaussianBuffer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as n}from"./chunk-2NO4YCLR.js";import{h as a,k as s}from"./chunk-T6O2SGH5.js";import"./chunk-WOT6VMZA.js";import{Mesh as u,MeshStandardMaterial as p,Points as f,PointsMaterial as m}from"three";import{STLLoader as c}from"three/addons/loaders/STLLoader.js";import{PLYLoader as M}from"three/addons/loaders/PLYLoader.js";function h(e,o){o?.upAxis==="z"&&(e.rotation.x=-Math.PI/2)}function i(e){let o=!!e.hasColors||!!e.getAttribute("color"),t=typeof e.alpha=="number"?e.alpha:1;return new p({vertexColors:o,opacity:t,transparent:t<1})}function L(e){return e.groups.length>1?e.groups.map(()=>i(e)):i(e)}function d(e,o,t){let r=t==="points"?new f(e,new m({size:1,vertexColors:!!e.getAttribute("color")})):new u(e,L(e));return h(r,o),{object:r,animations:[]}}function x(e,o){let t=new c().parse(e);return d(t,o,"mesh")}function A(e,o){let t=new M().parse(e);!t.getAttribute("normal")&&t.getIndex()&&t.computeVertexNormals();let r=t.getIndex()?"mesh":"points";return d(t,o,r)}var l=class{isSupported(o){let t=s(o);return t==="stl"||t==="ply"}async load(o,t){let r=await n(o,t);return s(o)==="stl"?x(r,t):A(r,t)}clone(o){return{object:a(o.object),animations:[]}}};export{l as GeometryMeshAdapter,d as meshResultFromGeometry,A as parseMeshPlyBuffer,x as parseStlBuffer};
|
package/dist/graphics.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { Z as ZylemPostEffect } from './zylem-camera-
|
|
1
|
+
import { e as ZylemTSLShader } from './material-D1IVeQc5.js';
|
|
2
|
+
export { E as EntityGlowOptions, f as ZylemShader, Z as ZylemShaderObject, b as applyEntityGlow, d as createEntityGlowMaterial, c as createNodeMaterialFromTSL, a as isGLSLShader, i as isTSLShader } from './material-D1IVeQc5.js';
|
|
3
|
+
export { Z as ZylemPostEffect } from './zylem-camera-BA3VPFlS.js';
|
|
4
4
|
export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
|
|
5
5
|
export { Fn, abs, asin, atan, clamp, cos, dot, exp, float, floor, fract, length, max, min, mix, mod, normalize, positionWorld, positionWorldDirection, pow, sin, smoothstep, step, time, uniform, uv, vec2, vec3, vec4 } from 'three/tsl';
|
|
6
6
|
import 'three';
|
package/dist/graphics.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as p,b as q,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as z,l as A,m as B,n as C,o as D,p as E,q as F,r as G,s as H,t as I,u as J,v as K,w as L}from"./chunk-4DAITCJS.js";import{a as o}from"./chunk-7GYFZKK7.js";import{c as a,d as b,g as c,h as d,i as e,j as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n}from"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import"./chunk-QXVH6POE.js";import"./chunk-7WRQ2UAN.js";import"./chunk-WOT6VMZA.js";export{n as Fn,A as abs,d as applyEntityGlow,z as asin,y as atan,v as clamp,x as cos,p as createBackgroundShader,c as createEntityGlowMaterial,g as createNodeMaterialFromTSL,o as crossfadeTransitionShader,I as dot,B as exp,m as float,G as floor,H as fract,f as isGLSLShader,e as isTSLShader,J as length,E as max,F as min,t as mix,L as mod,s as normalize,a as objectVertexShader,r as positionWorld,q as positionWorldDirection,C as pow,w as sin,u as smoothstep,b as standardShader,D as step,j as time,h as uniform,i as uv,K as vec2,k as vec3,l as vec4};
|
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Color, Material, Blending, Side } from 'three';
|
|
2
2
|
import { MeshBasicNodeMaterial } from 'three/webgpu';
|
|
3
3
|
import { b as Vec2Input } from './vector-D3eDzvcA.js';
|
|
4
4
|
|
|
5
5
|
declare function shortHash(objString: string): string;
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Inexpensive fresnel glow for an entity material.
|
|
9
|
+
*
|
|
10
|
+
* This is one extra term in the material shader. It does not add a bloom
|
|
11
|
+
* pass or a second mesh.
|
|
12
|
+
*/
|
|
13
|
+
interface EntityGlowOptions {
|
|
14
|
+
/** Glow color. Defaults to the material color, then white. */
|
|
15
|
+
color?: Color | string;
|
|
16
|
+
/** Brightness multiplier. Default `2.8`. */
|
|
17
|
+
intensity?: number;
|
|
18
|
+
/**
|
|
19
|
+
* How far a flat-color glow extends past the surface, in local units.
|
|
20
|
+
* `0` keeps the mesh size. Default `0.06`. Ignored when glow is added
|
|
21
|
+
* as emissive light on a textured or custom-shader material.
|
|
22
|
+
*/
|
|
23
|
+
size?: number;
|
|
24
|
+
/**
|
|
25
|
+
* How quickly brightness falls toward the silhouette.
|
|
26
|
+
* Higher values keep the hot core tighter. Default `1.6`.
|
|
27
|
+
*/
|
|
28
|
+
falloff?: number;
|
|
29
|
+
}
|
|
30
|
+
interface ResolvedEntityGlow {
|
|
31
|
+
color: Color | string;
|
|
32
|
+
intensity: number;
|
|
33
|
+
size: number;
|
|
34
|
+
falloff: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Unlit additive glow. Bright at the center and faded at a slightly expanded
|
|
38
|
+
* silhouette, so a small mesh reads as a soft halo in a single draw.
|
|
39
|
+
*/
|
|
40
|
+
declare function createEntityGlowMaterial(options: ResolvedEntityGlow): MeshBasicNodeMaterial;
|
|
41
|
+
/**
|
|
42
|
+
* Add a fresnel emissive term to an existing node material.
|
|
43
|
+
* The original color, texture, or shader stays in place.
|
|
44
|
+
*/
|
|
45
|
+
declare function applyEntityGlow(material: Material, options: ResolvedEntityGlow): void;
|
|
46
|
+
|
|
7
47
|
/**
|
|
8
48
|
* GLSL shader object (traditional WebGL approach).
|
|
9
49
|
*
|
|
@@ -63,6 +103,12 @@ interface MaterialOptions {
|
|
|
63
103
|
* This flag is ignored.
|
|
64
104
|
*/
|
|
65
105
|
useTSL?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Soft fresnel glow in the material shader. A flat color becomes an unlit
|
|
108
|
+
* additive halo. A texture or custom shader keeps its surface and gains
|
|
109
|
+
* emissive rim light. This does not add a bloom pass.
|
|
110
|
+
*/
|
|
111
|
+
glow?: boolean | EntityGlowOptions;
|
|
66
112
|
}
|
|
67
113
|
type SharedGeometryMap = Map<symbol, number>;
|
|
68
114
|
interface SharedMaterialMapEntry {
|
|
@@ -123,4 +169,4 @@ declare class MaterialBuilder {
|
|
|
123
169
|
*/
|
|
124
170
|
declare function createNodeMaterialFromTSL(tslShader: ZylemTSLShader, opacity?: number): MeshBasicNodeMaterial;
|
|
125
171
|
|
|
126
|
-
export { MaterialBuilder as M, type TexturePath as T, type ZylemShaderObject as Z, isGLSLShader as a,
|
|
172
|
+
export { type EntityGlowOptions as E, MaterialBuilder as M, type TexturePath as T, type ZylemShaderObject as Z, isGLSLShader as a, applyEntityGlow as b, createNodeMaterialFromTSL as c, createEntityGlowMaterial as d, type ZylemTSLShader as e, type ZylemShader as f, type MaterialOptions as g, isTSLShader as i };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r}from"./chunk-2NO4YCLR.js";import{h as m,j as d,k as c,l as p}from"./chunk-T6O2SGH5.js";import"./chunk-WOT6VMZA.js";import{MTLLoader as L}from"three/addons/loaders/MTLLoader.js";import{OBJLoader as b}from"three/addons/loaders/OBJLoader.js";function f(a){return/^mtllib\s+(.+)$/m.exec(a)?.[1]?.trim()||null}var u=class{isSupported(t){return c(t)==="obj"}async load(t,e){let l=await r(t,e),n=new b,s=e?.mtlPath?null:f(l),o=e?.mtlPath??(s?p(s,t):null);if(o){let i=new L().parse(await r(o,e),d(o));i.preload(),n.setMaterials(i)}return{object:n.parse(l),animations:[]}}clone(t){return{object:m(t.object),animations:[]}}};export{u as OBJLoaderAdapter,f as readObjMaterialLibrary};
|