lecodes-cli 0.18.1 → 0.19.0
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/index.js +2096 -506
- package/package.json +3 -2
- package/runtime/scene-harness.json +1 -1
- package/runtime/sdk/core/Aspect.ts +65 -9
- package/runtime/sdk/core/StateMachine.ts +308 -0
- package/runtime/sdk/core/time.ts +3 -0
- package/runtime/sdk/gl/Camera.ts +39 -0
- package/runtime/sdk/gl/Light.ts +12 -4
- package/runtime/sdk/gl/Lightmap.ts +87 -10
- package/runtime/sdk/gl/Material.ts +15 -0
- package/runtime/sdk/gl/Model.ts +68 -8
- package/runtime/sdk/gl/NavAgent.ts +337 -0
- package/runtime/sdk/gl/NavMesh.ts +397 -0
- package/runtime/sdk/gl/Ragdoll.ts +270 -0
- package/runtime/sdk/gl/Scene.ts +20 -0
- package/runtime/sdk/gl/Shape.ts +37 -5
- package/runtime/sdk/gl/Terrain.ts +1092 -0
- package/runtime/sdk/gl/Texture.ts +17 -0
- package/runtime/sdk/gl/animation/Animator.ts +35 -2
- package/runtime/sdk/gl/animation/Layer.ts +3 -1
- package/runtime/sdk/gl/animation/Loop.ts +5 -0
- package/runtime/sdk/gl/animation/Playback.ts +4 -3
- package/runtime/sdk/gl/animation/core.ts +52 -10
- package/runtime/sdk/gl/terrainMesh.ts +219 -0
- package/runtime/sdk/inject.ts +12 -1
- package/runtime/sdk/net/codec.ts +119 -0
- package/runtime/sdk/net/core.ts +384 -0
- package/runtime/sdk/net/index.ts +181 -0
- package/runtime/sdk/net/replication.ts +622 -0
- package/runtime/sdk/runtime/device.ts +102 -1
- package/runtime/sdk/scene/defineScene.ts +1353 -1227
- package/runtime/sdk/scene/editorPlugins.ts +18 -0
- package/runtime/sdk/ui/UINode.ts +4 -0
- package/runtime/sdk-types.json +1 -1
|
@@ -52,6 +52,15 @@ export type EditorApi = {
|
|
|
52
52
|
raycast(screenX: number, screenY: number): EditorRayHit | null
|
|
53
53
|
/** Group every doc edit inside `fn` into ONE undo step. */
|
|
54
54
|
transact(fn: () => void): void
|
|
55
|
+
/** Read one def prop of a node as document data (`asset()` refs come as `{ $asset: "./x" }`);
|
|
56
|
+
* undefined when the node or key doesn't exist. */
|
|
57
|
+
getProp(path: string, key: string): unknown
|
|
58
|
+
/** Write a BINARY asset file for a node (a terrain's `.terrain`, a baked mask…). `ref` = the
|
|
59
|
+
* node's existing def-relative `asset()` ref to overwrite, or null to create `./<name>` at the
|
|
60
|
+
* project root (a free name is picked on collisions). Resolves to the ref to store in the node's
|
|
61
|
+
* def (`{ $asset: ref }` via `setProp`), null when the host can't write files. Not a doc edit —
|
|
62
|
+
* it is not undoable; keep the doc pointing at the file. */
|
|
63
|
+
writeAsset(path: string, ref: string | null, name: string, bytes: Uint8Array): Promise<string | null>
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
export type EditorWindowFn = (ui: InspectorUI, editor: EditorApi) => void
|
|
@@ -65,6 +74,15 @@ export type EditorToolHooks = {
|
|
|
65
74
|
/** A viewport click while the tool is active — `hit` is the raycast result under the pointer.
|
|
66
75
|
* Viewport clicks route to the tool while it is active. */
|
|
67
76
|
onViewportClick?(hit: EditorRayHit, editor: EditorApi): void
|
|
77
|
+
/** Drag tools (brushes): a primary-button drag in the viewport routes here instead of orbiting
|
|
78
|
+
* the camera — start / every pointer move (with the hit under it, null while off-world) /
|
|
79
|
+
* release. A tool with `onDragStart` gets NO `onViewportClick` for the same gesture. */
|
|
80
|
+
onDragStart?(hit: EditorRayHit, editor: EditorApi): void
|
|
81
|
+
onDrag?(hit: EditorRayHit | null, editor: EditorApi): void
|
|
82
|
+
onDragEnd?(editor: EditorApi): void
|
|
83
|
+
/** The pointer moved over the viewport with no button down (throttled to the frame) — draw a
|
|
84
|
+
* brush cursor through `Gizmos`; null when nothing is under it. */
|
|
85
|
+
onHover?(hit: EditorRayHit | null, editor: EditorApi): void
|
|
68
86
|
}
|
|
69
87
|
|
|
70
88
|
/** @internal The registry the scene-editor harness reads (windows/tools in registration order). */
|
package/runtime/sdk/ui/UINode.ts
CHANGED
|
@@ -26,6 +26,10 @@ export type Color = number | string | null
|
|
|
26
26
|
export type BaseStyle = {
|
|
27
27
|
opacity?: number | `${number}`,
|
|
28
28
|
transform?: string | null,
|
|
29
|
+
/** Pivot of `transform` (CSS `transform-origin` subset): one or two values, each a keyword
|
|
30
|
+
* (`left`/`center`/`right`, `top`/`center`/`bottom`), a percentage of the box, or a px length
|
|
31
|
+
* (bare numbers are px). One value sets x, y stays `50%`. Default `"50% 50%"` = the centre. */
|
|
32
|
+
transformOrigin?: string | null,
|
|
29
33
|
backgroundColor?: Color | null,
|
|
30
34
|
bgColor?: Color | null,
|
|
31
35
|
overflow?: "visible" | "hidden",
|