@snaptrude/plugin-core 0.10.0 → 1.0.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/AGENTS.md +4 -0
- package/CHANGELOG.md +187 -3
- package/api-manifest.json +929 -25
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +463 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +942 -101
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +59 -2
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +59 -35
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/edge.d.ts +2 -2
- package/dist/api/core/geom/query/face.d.ts +105 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +10 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +3 -1
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/handles/index.d.ts +4 -2
- package/dist/api/core/handles/index.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +4 -4
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +377 -255
- package/dist/api/core/layers.d.ts.map +1 -1
- package/dist/api/core/mode/index.d.ts +19 -7
- package/dist/api/core/mode/index.d.ts.map +1 -1
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +4 -3
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +31 -2
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/storeys/layers.d.ts +408 -0
- package/dist/api/core/storeys/layers.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +84 -3
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +299 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +269 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/grids.d.ts +132 -0
- package/dist/api/design/create/grids.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +752 -78
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +38 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +5 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +24 -23
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +1446 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +33 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/grids.d.ts +237 -0
- package/dist/api/design/grids.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +30 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +33 -5
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/grids.d.ts +287 -0
- package/dist/api/design/query/grids.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +143 -34
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -5
- package/dist/api/design/selection/index.d.ts +12 -12
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +412 -8
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +28 -0
- package/dist/api/design/visibility.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +84 -2
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +13 -1
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +12 -12
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/aiInspiration.d.ts +24 -24
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/graphics.d.ts +419 -0
- package/dist/api/presentation/graphics.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +66 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +116 -16
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/sections.d.ts +461 -0
- package/dist/api/presentation/sections.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -19
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/standards.d.ts +590 -0
- package/dist/api/presentation/standards.d.ts.map +1 -0
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +144 -9
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +1350 -0
- package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +58 -2
- package/dist/api/program/departments.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +16 -6
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/metadata.d.ts +328 -0
- package/dist/api/program/metadata.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +267 -4
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +49 -2
- package/dist/api/workspace/index.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +3 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/handles.d.ts +32 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +6539 -2804
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6121 -2801
- package/dist/index.js.map +1 -1
- package/dist/massParameters.d.ts +287 -0
- package/dist/massParameters.d.ts.map +1 -0
- package/dist/massParameters.ops.d.ts +138 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +14 -13
- package/scripts/check-dist-fresh.mjs +22 -0
- package/scripts/generate-manifest.mjs +5 -0
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/camera/index.ts +446 -1
- package/src/api/core/geom/create/index.ts +1037 -102
- package/src/api/core/geom/query/brep.ts +60 -2
- package/src/api/core/geom/query/curve.ts +26 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/core/geom/update/contour.ts +10 -2
- package/src/api/core/geom/update/profile.ts +2 -0
- package/src/api/core/handles/index.ts +3 -2
- package/src/api/core/index.ts +4 -4
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/mode/index.ts +19 -7
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +34 -2
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/core/tags.ts +76 -0
- package/src/api/core/zoom/index.ts +13 -0
- package/src/api/design/bim.ts +210 -0
- package/src/api/design/boolean/index.ts +2 -0
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +294 -0
- package/src/api/design/create/grids.ts +137 -0
- package/src/api/design/create/index.ts +823 -114
- package/src/api/design/create/opening-fields.ts +40 -0
- package/src/api/design/delete/index.ts +5 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +64 -41
- package/src/api/design/family.ts +1342 -0
- package/src/api/design/furniture/index.ts +34 -0
- package/src/api/design/grids.ts +237 -0
- package/src/api/design/index.ts +49 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/geometry/index.ts +35 -4
- package/src/api/design/query/grids.ts +197 -0
- package/src/api/design/query/index.ts +105 -3
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +398 -4
- package/src/api/design/visibility.ts +34 -0
- package/src/api/design/windows/index.ts +40 -22
- package/src/api/entity/buildableEnvelope.ts +77 -2
- package/src/api/entity/referenceLine.ts +25 -12
- package/src/api/presentation/annotate.ts +90 -58
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +32 -6
- package/src/api/presentation/graphics.ts +324 -0
- package/src/api/presentation/index.ts +73 -14
- package/src/api/presentation/placedViews.ts +119 -28
- package/src/api/presentation/sections.ts +420 -0
- package/src/api/presentation/sheets.ts +181 -20
- package/src/api/presentation/standards.ts +445 -0
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +81 -10
- package/src/api/presentation/walkthroughs.ts +1201 -0
- package/src/api/program/departments.ts +54 -2
- package/src/api/program/index.ts +16 -6
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/spreadsheet.ts +282 -0
- package/src/api/workspace/index.ts +51 -2
- package/src/errors/codes.ts +7 -0
- package/src/handles.ts +42 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +246 -0
- package/src/massParameters.ts +427 -0
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +1 -0
- package/test/massParameters.test.mjs +952 -0
- package/test/paperPensContract.test.mjs +75 -0
- package/test/presentationViewSettings.test.mjs +85 -0
|
@@ -149,8 +149,8 @@ export type PluginDaylightMetric = z.infer<typeof PluginDaylightMetric>;
|
|
|
149
149
|
export declare const PluginDaylightRunStatus: z.ZodEnum<{
|
|
150
150
|
complete: "complete";
|
|
151
151
|
failed: "failed";
|
|
152
|
-
running: "running";
|
|
153
152
|
cancelled: "cancelled";
|
|
153
|
+
running: "running";
|
|
154
154
|
}>;
|
|
155
155
|
export type PluginDaylightRunStatus = z.infer<typeof PluginDaylightRunStatus>;
|
|
156
156
|
/**
|
|
@@ -419,8 +419,8 @@ export type PluginDaylightSensorRecord = z.infer<typeof PluginDaylightSensorReco
|
|
|
419
419
|
*/
|
|
420
420
|
export declare const PluginDaylightAggregateScope: z.ZodEnum<{
|
|
421
421
|
storey: "storey";
|
|
422
|
-
space: "space";
|
|
423
422
|
project: "project";
|
|
423
|
+
space: "space";
|
|
424
424
|
}>;
|
|
425
425
|
export type PluginDaylightAggregateScope = z.infer<typeof PluginDaylightAggregateScope>;
|
|
426
426
|
/**
|
|
@@ -438,8 +438,8 @@ export type PluginDaylightAggregateScope = z.infer<typeof PluginDaylightAggregat
|
|
|
438
438
|
export declare const PluginDaylightAggregate: z.ZodObject<{
|
|
439
439
|
scope: z.ZodEnum<{
|
|
440
440
|
storey: "storey";
|
|
441
|
-
space: "space";
|
|
442
441
|
project: "project";
|
|
442
|
+
space: "space";
|
|
443
443
|
}>;
|
|
444
444
|
id: z.ZodNullable<z.ZodString>;
|
|
445
445
|
analysisAreaM2: z.ZodNumber;
|
|
@@ -521,8 +521,8 @@ export declare const PluginDaylightResults: z.ZodObject<{
|
|
|
521
521
|
status: z.ZodEnum<{
|
|
522
522
|
complete: "complete";
|
|
523
523
|
failed: "failed";
|
|
524
|
-
running: "running";
|
|
525
524
|
cancelled: "cancelled";
|
|
525
|
+
running: "running";
|
|
526
526
|
}>;
|
|
527
527
|
runId: z.ZodOptional<z.ZodString>;
|
|
528
528
|
sensors: z.ZodArray<z.ZodObject<{
|
|
@@ -540,8 +540,8 @@ export declare const PluginDaylightResults: z.ZodObject<{
|
|
|
540
540
|
aggregates: z.ZodArray<z.ZodObject<{
|
|
541
541
|
scope: z.ZodEnum<{
|
|
542
542
|
storey: "storey";
|
|
543
|
-
space: "space";
|
|
544
543
|
project: "project";
|
|
544
|
+
space: "space";
|
|
545
545
|
}>;
|
|
546
546
|
id: z.ZodNullable<z.ZodString>;
|
|
547
547
|
analysisAreaM2: z.ZodNumber;
|
|
@@ -70,8 +70,8 @@ export declare abstract class PluginAnalysisSolarApi {
|
|
|
70
70
|
export declare const PluginSolarRunStatus: z.ZodEnum<{
|
|
71
71
|
complete: "complete";
|
|
72
72
|
failed: "failed";
|
|
73
|
-
running: "running";
|
|
74
73
|
cancelled: "cancelled";
|
|
74
|
+
running: "running";
|
|
75
75
|
}>;
|
|
76
76
|
export type PluginSolarRunStatus = z.infer<typeof PluginSolarRunStatus>;
|
|
77
77
|
/**
|
|
@@ -198,8 +198,8 @@ export declare const PluginSolarSampleGridResult: z.ZodObject<{
|
|
|
198
198
|
status: z.ZodEnum<{
|
|
199
199
|
complete: "complete";
|
|
200
200
|
failed: "failed";
|
|
201
|
-
running: "running";
|
|
202
201
|
cancelled: "cancelled";
|
|
202
|
+
running: "running";
|
|
203
203
|
}>;
|
|
204
204
|
mode: z.ZodEnum<{
|
|
205
205
|
range: "range";
|
|
@@ -9,6 +9,18 @@ import { Vec3Handle } from "../../../handles";
|
|
|
9
9
|
* canvas view menu and the 2D/3D toggle. Like {@linkcode PluginZoomApi}, these
|
|
10
10
|
* are transient VIEW-STATE changes: they are not model edits, so they are not
|
|
11
11
|
* write-gated and are not undoable. Accessed via `snaptrude.core.camera`.
|
|
12
|
+
*
|
|
13
|
+
* Read and set the full camera pose (`getPose`/`setPose`), walk and turn it the
|
|
14
|
+
* way the arrow keys do (`move`/`rotate`), and read or change the arrow-key
|
|
15
|
+
* navigation settings (`getNavigationSettings`/`updateNavigationSettings`).
|
|
16
|
+
* Positions are world coordinates in internal `babylon` units (1 unit =
|
|
17
|
+
* 0.254 m, Y up); yaw is degrees clockwise from +z seen from above, pitch is
|
|
18
|
+
* degrees above level.
|
|
19
|
+
*
|
|
20
|
+
* While Present mode is open these calls set the Design frame a view saved in
|
|
21
|
+
* Present (`presentation.views.create`) is taken from; they never move the
|
|
22
|
+
* Present sheet canvas. To pan, zoom or screenshot the Present canvas, use
|
|
23
|
+
* {@linkcode PluginPresentationCameraApi} (`presentation.camera`).
|
|
12
24
|
*/
|
|
13
25
|
export declare abstract class PluginCameraApi {
|
|
14
26
|
constructor();
|
|
@@ -16,6 +28,10 @@ export declare abstract class PluginCameraApi {
|
|
|
16
28
|
* Point the camera: place its eye at `eye` looking toward `target` (world
|
|
17
29
|
* coordinates, internal `babylon` units). View-state only — not undoable.
|
|
18
30
|
*
|
|
31
|
+
* While Present is open this sets the Design frame a view saved in Present
|
|
32
|
+
* is taken from; it never moves the Present sheet canvas; use
|
|
33
|
+
* `presentation.camera` for that.
|
|
34
|
+
*
|
|
19
35
|
* @param eye - Camera position as a {@linkcode Vec3Handle}
|
|
20
36
|
* @param target - Point the camera looks at as a {@linkcode Vec3Handle}
|
|
21
37
|
* @returns `true` once the camera has been positioned.
|
|
@@ -38,6 +54,10 @@ export declare abstract class PluginCameraApi {
|
|
|
38
54
|
* perspective) view. Mirrors the canvas view menu. View-state only — not
|
|
39
55
|
* undoable. The orthographic presets exit 2D mode first if needed.
|
|
40
56
|
*
|
|
57
|
+
* While Present is open this sets the Design frame a view saved in Present
|
|
58
|
+
* is taken from; it never moves the Present sheet canvas; use
|
|
59
|
+
* `presentation.camera` for that.
|
|
60
|
+
*
|
|
41
61
|
* @param view - The standard view to snap to ({@linkcode PluginStandardView})
|
|
42
62
|
* @returns `true` once the view has been applied.
|
|
43
63
|
*
|
|
@@ -53,11 +73,31 @@ export declare abstract class PluginCameraApi {
|
|
|
53
73
|
* ```
|
|
54
74
|
*/
|
|
55
75
|
abstract setStandardView(view: PluginStandardView): PluginApiReturn<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* Get the current camera mode. Paired with {@linkcode PluginCameraApi.setMode}.
|
|
78
|
+
*
|
|
79
|
+
* @returns `"2d"` when the editor is in plan view, `"3d"` otherwise.
|
|
80
|
+
*
|
|
81
|
+
* @examplePrompt Am I in 2D or 3D?
|
|
82
|
+
* @examplePrompt What view mode is the editor in?
|
|
83
|
+
*
|
|
84
|
+
* # Example
|
|
85
|
+
* ```ts
|
|
86
|
+
* if ((await snaptrude.core.camera.getMode()) === "2d") {
|
|
87
|
+
* await snaptrude.core.camera.setMode("3d")
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
abstract getMode(): PluginApiReturn<PluginCameraMode>;
|
|
56
92
|
/**
|
|
57
93
|
* Toggle the modelling mode between `2d` (plan) and `3d`. Mirrors the canvas
|
|
58
94
|
* 2D/3D toggle: `3d` enters the isometric perspective view, `2d` drops to the
|
|
59
95
|
* orthographic plan of the active storey. View-state only — not undoable.
|
|
60
96
|
*
|
|
97
|
+
* While Present is open this sets the Design frame a view saved in Present
|
|
98
|
+
* is taken from; it never moves the Present sheet canvas; use
|
|
99
|
+
* `presentation.camera` for that.
|
|
100
|
+
*
|
|
61
101
|
* @param mode - `"2d"` or `"3d"` ({@linkcode PluginCameraMode})
|
|
62
102
|
* @returns `true` once the mode switch has been requested.
|
|
63
103
|
*
|
|
@@ -100,6 +140,10 @@ export declare abstract class PluginCameraApi {
|
|
|
100
140
|
* `"orthographic"` is accepted as a no-op, while `"perspective"` is
|
|
101
141
|
* rejected — switch to 3D first via `setMode("3d")`.
|
|
102
142
|
*
|
|
143
|
+
* While Present is open this sets the Design frame a view saved in Present
|
|
144
|
+
* is taken from; it never moves the Present sheet canvas; use
|
|
145
|
+
* `presentation.camera` for that.
|
|
146
|
+
*
|
|
103
147
|
* @param projection - `"perspective"` or `"orthographic"` ({@linkcode PluginCameraProjection})
|
|
104
148
|
* @returns `true` once the projection has been applied.
|
|
105
149
|
*
|
|
@@ -120,6 +164,10 @@ export declare abstract class PluginCameraApi {
|
|
|
120
164
|
* action. View-state only — not undoable. Canonical home of the zoom-extents
|
|
121
165
|
* read (the deprecated `core.zoom.extents`).
|
|
122
166
|
*
|
|
167
|
+
* While Present is open this sets the Design frame a view saved in Present
|
|
168
|
+
* is taken from; it never moves the Present sheet canvas; use
|
|
169
|
+
* `presentation.camera` for that.
|
|
170
|
+
*
|
|
123
171
|
* @returns `true` once the camera has been framed to the scene.
|
|
124
172
|
*
|
|
125
173
|
* @examplePrompt Zoom out so I can see the whole model
|
|
@@ -138,6 +186,10 @@ export declare abstract class PluginCameraApi {
|
|
|
138
186
|
* undoable. Canonical home of the zoom-to-selection read (the deprecated
|
|
139
187
|
* `core.zoom.selection`).
|
|
140
188
|
*
|
|
189
|
+
* While Present is open this sets the Design frame a view saved in Present
|
|
190
|
+
* is taken from; it never moves the Present sheet canvas; use
|
|
191
|
+
* `presentation.camera` for that.
|
|
192
|
+
*
|
|
141
193
|
* @returns `true` if there was a selection to frame; `false` if nothing is
|
|
142
194
|
* selected (no-op).
|
|
143
195
|
*
|
|
@@ -152,6 +204,162 @@ export declare abstract class PluginCameraApi {
|
|
|
152
204
|
* ```
|
|
153
205
|
*/
|
|
154
206
|
abstract zoomSelection(): PluginApiReturn<boolean>;
|
|
207
|
+
/**
|
|
208
|
+
* Read where the camera is and where it looks: the eye and target positions
|
|
209
|
+
* (world coordinates, internal `babylon` units), the view direction as yaw
|
|
210
|
+
* and pitch, the vertical field of view, the projection and the 2D/3D mode.
|
|
211
|
+
* Paired with {@linkcode PluginCameraApi.setPose}.
|
|
212
|
+
*
|
|
213
|
+
* @returns The current {@linkcode PluginCameraPose}.
|
|
214
|
+
* @throws PRECONDITION_FAILED when there is no active camera.
|
|
215
|
+
*
|
|
216
|
+
* @examplePrompt Where is the camera right now?
|
|
217
|
+
* @examplePrompt Remember this viewpoint so we can come back to it
|
|
218
|
+
* @examplePrompt Which way is the camera facing?
|
|
219
|
+
* @examplePrompt How high above the ground is the camera?
|
|
220
|
+
*
|
|
221
|
+
* # Example
|
|
222
|
+
* ```ts
|
|
223
|
+
* const pose = await snaptrude.core.camera.getPose()
|
|
224
|
+
* console.log(pose.eye, pose.yawInDegrees, pose.pitchInDegrees)
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
abstract getPose(): PluginApiReturn<PluginCameraPose>;
|
|
228
|
+
/**
|
|
229
|
+
* Place the camera, optionally easing there over `options.durationInSeconds`,
|
|
230
|
+
* and resolve once the new view has been drawn, so a capture that follows sees
|
|
231
|
+
* it without a fixed wait. `pose` is one of:
|
|
232
|
+
*
|
|
233
|
+
* - `{ eye, target }`: stand at `eye` looking at `target`, as
|
|
234
|
+
* {@linkcode PluginCameraApi.lookFrom} does with handles;
|
|
235
|
+
* - `{ eye, yawInDegrees, pitchInDegrees }`: stand at `eye` looking along a
|
|
236
|
+
* direction;
|
|
237
|
+
* - `{ standAt, yawInDegrees? }`: stand on the floor, stair, terrain or
|
|
238
|
+
* ground at or below `standAt`, at the user's eye height above it (the `I`
|
|
239
|
+
* key), facing `yawInDegrees` (the current yaw when omitted).
|
|
240
|
+
*
|
|
241
|
+
* Stops a playing walkthrough and switches from 2D plan view to 3D first.
|
|
242
|
+
* View-state only: not write-gated, not undoable.
|
|
243
|
+
*
|
|
244
|
+
* @param pose - Where to put the camera ({@linkcode PluginCameraPoseInput})
|
|
245
|
+
* @param options - `durationInSeconds`: ease over this long (0 to 10, default 0 jumps)
|
|
246
|
+
* @returns The camera's {@linkcode PluginCameraPose} once it has arrived.
|
|
247
|
+
* @throws PRECONDITION_FAILED when there is no active camera, while a
|
|
248
|
+
* walkthrough export is recording, or when `standAt` lies below the ground
|
|
249
|
+
* with nothing under it. VALIDATION when `eye` and `target` coincide or a
|
|
250
|
+
* pitch is beyond ±89°.
|
|
251
|
+
*
|
|
252
|
+
* @examplePrompt Stand in the living room at eye level facing the window
|
|
253
|
+
* @examplePrompt Move the camera to (40, 12, 30) looking at the entrance
|
|
254
|
+
* @examplePrompt Fly the camera smoothly over to the courtyard
|
|
255
|
+
* @examplePrompt Put me back at the viewpoint we saved earlier
|
|
256
|
+
*
|
|
257
|
+
* # Example
|
|
258
|
+
* ```ts
|
|
259
|
+
* const { camera } = snaptrude.core
|
|
260
|
+
* await camera.setPose({ standAt: { x: 20, y: 0, z: 35 }, yawInDegrees: 90 })
|
|
261
|
+
* await camera.setPose(
|
|
262
|
+
* { eye: { x: 60, y: 25, z: 60 }, target: { x: 0, y: 5, z: 0 } },
|
|
263
|
+
* { durationInSeconds: 1.5 },
|
|
264
|
+
* )
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
abstract setPose(pose: PluginCameraPoseInput, options?: PluginCameraSetPoseOptions): PluginApiReturn<PluginCameraPose>;
|
|
268
|
+
/**
|
|
269
|
+
* Walk or fly the camera by a displacement in its own frame: `forward` along
|
|
270
|
+
* the level view direction, `right` to its side and `up` vertically, in
|
|
271
|
+
* internal `babylon` units. The view direction does not change. With
|
|
272
|
+
* `options.followsFloor` the camera keeps its height above the floor as it
|
|
273
|
+
* goes, climbing and descending stairs and ramps the way the arrow keys do.
|
|
274
|
+
* Stops a playing walkthrough and switches from 2D plan view to 3D first.
|
|
275
|
+
* View-state only: not write-gated, not undoable.
|
|
276
|
+
*
|
|
277
|
+
* @param displacement - {@linkcode PluginCameraMoveDisplacement}; omitted components are 0
|
|
278
|
+
* @param options - `followsFloor` (default `false`) and `durationInSeconds` (0 to 10, default 0)
|
|
279
|
+
* @returns The camera's {@linkcode PluginCameraPose} after the move.
|
|
280
|
+
* @throws PRECONDITION_FAILED when there is no active camera, or while a
|
|
281
|
+
* walkthrough export is recording.
|
|
282
|
+
*
|
|
283
|
+
* @examplePrompt Walk forward 3 metres
|
|
284
|
+
* @examplePrompt Step to the right a little
|
|
285
|
+
* @examplePrompt Walk up the stairs ahead
|
|
286
|
+
* @examplePrompt Raise the camera by 2 metres
|
|
287
|
+
*
|
|
288
|
+
* # Example
|
|
289
|
+
* ```ts
|
|
290
|
+
* const metre = 1 / 0.254
|
|
291
|
+
* await snaptrude.core.camera.move(
|
|
292
|
+
* { forward: 3 * metre },
|
|
293
|
+
* { followsFloor: true, durationInSeconds: 2 },
|
|
294
|
+
* )
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
abstract move(displacement: PluginCameraMoveDisplacement, options?: PluginCameraMoveOptions): PluginApiReturn<PluginCameraPose>;
|
|
298
|
+
/**
|
|
299
|
+
* Turn the camera in place by signed angles: `yawInDegrees` to the right
|
|
300
|
+
* (clockwise seen from above) and `pitchInDegrees` up. The eye does not move;
|
|
301
|
+
* the resulting pitch is kept within ±89°. Stops a playing walkthrough and
|
|
302
|
+
* switches from 2D plan view to 3D first. View-state only: not write-gated,
|
|
303
|
+
* not undoable.
|
|
304
|
+
*
|
|
305
|
+
* @param yawInDegrees - Turn to the right by this much (negative turns left)
|
|
306
|
+
* @param pitchInDegrees - Tilt up by this much (negative tilts down; default 0)
|
|
307
|
+
* @param options - `durationInSeconds` (0 to 10, default 0)
|
|
308
|
+
* @returns The camera's {@linkcode PluginCameraPose} after turning.
|
|
309
|
+
* @throws PRECONDITION_FAILED when there is no active camera, or while a
|
|
310
|
+
* walkthrough export is recording.
|
|
311
|
+
*
|
|
312
|
+
* @examplePrompt Turn around
|
|
313
|
+
* @examplePrompt Look 45 degrees to the left
|
|
314
|
+
* @examplePrompt Tilt the camera down a bit
|
|
315
|
+
*
|
|
316
|
+
* # Example
|
|
317
|
+
* ```ts
|
|
318
|
+
* await snaptrude.core.camera.rotate(180, 0, { durationInSeconds: 1 })
|
|
319
|
+
* ```
|
|
320
|
+
*/
|
|
321
|
+
abstract rotate(yawInDegrees: number, pitchInDegrees?: number, options?: PluginCameraRotateOptions): PluginApiReturn<PluginCameraPose>;
|
|
322
|
+
/**
|
|
323
|
+
* Read the arrow-key navigation settings: whether the arrow keys walk the
|
|
324
|
+
* camera, the eye height used by `setPose`'s `standAt` and by walkthroughs
|
|
325
|
+
* that follow the floor, the walking speed, and whether walking stops at
|
|
326
|
+
* walls. Paired with {@linkcode PluginCameraApi.updateNavigationSettings}.
|
|
327
|
+
*
|
|
328
|
+
* @returns The current {@linkcode PluginCameraNavigationSettings}.
|
|
329
|
+
*
|
|
330
|
+
* @examplePrompt Is arrow-key navigation on?
|
|
331
|
+
* @examplePrompt What eye height does the camera use?
|
|
332
|
+
*
|
|
333
|
+
* # Example
|
|
334
|
+
* ```ts
|
|
335
|
+
* const { isKeyboardNavigationEnabled } =
|
|
336
|
+
* await snaptrude.core.camera.getNavigationSettings()
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
abstract getNavigationSettings(): PluginApiReturn<PluginCameraNavigationSettings>;
|
|
340
|
+
/**
|
|
341
|
+
* Change arrow-key navigation settings; only the fields given change.
|
|
342
|
+
* `isKeyboardNavigationEnabled` is the user's Project Settings switch and is
|
|
343
|
+
* saved on this device; the other settings last for the session.
|
|
344
|
+
* Write-gated: this changes the user's preferences, not just the view.
|
|
345
|
+
*
|
|
346
|
+
* @param patch - The settings to change ({@linkcode PluginCameraNavigationSettingsPatch})
|
|
347
|
+
* @returns The {@linkcode PluginCameraNavigationSettings} after the change.
|
|
348
|
+
* @throws METHOD_NOT_PERMITTED when plugin writes are disabled.
|
|
349
|
+
*
|
|
350
|
+
* @examplePrompt Turn off arrow-key navigation
|
|
351
|
+
* @examplePrompt Use a 1.6 m eye height
|
|
352
|
+
* @examplePrompt Make walking stop at walls
|
|
353
|
+
*
|
|
354
|
+
* # Example
|
|
355
|
+
* ```ts
|
|
356
|
+
* await snaptrude.core.camera.updateNavigationSettings({
|
|
357
|
+
* eyeHeight: 1.6 / 0.254,
|
|
358
|
+
* isCollisionEnabled: true,
|
|
359
|
+
* })
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
abstract updateNavigationSettings(patch: PluginCameraNavigationSettingsPatch): PluginApiReturn<PluginCameraNavigationSettings>;
|
|
155
363
|
}
|
|
156
364
|
/**
|
|
157
365
|
* A standard camera view: the five orthographic elevations (`top`/`front`/
|
|
@@ -242,4 +450,259 @@ export declare const PluginCameraSetProjectionArgs: z.ZodObject<{
|
|
|
242
450
|
}>;
|
|
243
451
|
}, z.core.$strip>;
|
|
244
452
|
export type PluginCameraSetProjectionArgs = z.infer<typeof PluginCameraSetProjectionArgs>;
|
|
453
|
+
/**
|
|
454
|
+
* The camera's pose — result of {@linkcode PluginCameraApi.getPose},
|
|
455
|
+
* {@linkcode PluginCameraApi.setPose}, {@linkcode PluginCameraApi.move} and
|
|
456
|
+
* {@linkcode PluginCameraApi.rotate}.
|
|
457
|
+
*
|
|
458
|
+
* | Property | Type | Description |
|
|
459
|
+
* |---|---|---|
|
|
460
|
+
* | `eye` | `{ x, y, z }` | Camera position (world, `babylon` units) |
|
|
461
|
+
* | `target` | `{ x, y, z }` | Point the camera looks at |
|
|
462
|
+
* | `yawInDegrees` | `number` | View direction, degrees clockwise from +z seen from above (-180 to 180) |
|
|
463
|
+
* | `pitchInDegrees` | `number` | View direction, degrees above level (negative looks down) |
|
|
464
|
+
* | `fieldOfViewInDegrees` | `number` | Vertical field of view |
|
|
465
|
+
* | `projection` | {@linkcode PluginCameraProjection} | `"perspective"` or `"orthographic"` |
|
|
466
|
+
* | `mode` | {@linkcode PluginCameraMode} | `"2d"` or `"3d"` |
|
|
467
|
+
*/
|
|
468
|
+
export declare const PluginCameraPose: z.ZodObject<{
|
|
469
|
+
eye: z.ZodObject<{
|
|
470
|
+
x: z.ZodNumber;
|
|
471
|
+
y: z.ZodNumber;
|
|
472
|
+
z: z.ZodNumber;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
target: z.ZodObject<{
|
|
475
|
+
x: z.ZodNumber;
|
|
476
|
+
y: z.ZodNumber;
|
|
477
|
+
z: z.ZodNumber;
|
|
478
|
+
}, z.core.$strip>;
|
|
479
|
+
yawInDegrees: z.ZodNumber;
|
|
480
|
+
pitchInDegrees: z.ZodNumber;
|
|
481
|
+
fieldOfViewInDegrees: z.ZodNumber;
|
|
482
|
+
projection: z.ZodEnum<{
|
|
483
|
+
perspective: "perspective";
|
|
484
|
+
orthographic: "orthographic";
|
|
485
|
+
}>;
|
|
486
|
+
mode: z.ZodEnum<{
|
|
487
|
+
"2d": "2d";
|
|
488
|
+
"3d": "3d";
|
|
489
|
+
}>;
|
|
490
|
+
}, z.core.$strip>;
|
|
491
|
+
export type PluginCameraPose = z.infer<typeof PluginCameraPose>;
|
|
492
|
+
/**
|
|
493
|
+
* Where {@linkcode PluginCameraApi.setPose} puts the camera — exactly one of:
|
|
494
|
+
*
|
|
495
|
+
* | Shape | Meaning |
|
|
496
|
+
* |---|---|
|
|
497
|
+
* | `{ eye, target }` | Stand at `eye` looking at `target` |
|
|
498
|
+
* | `{ eye, yawInDegrees, pitchInDegrees }` | Stand at `eye` looking along a direction (pitch within ±89°) |
|
|
499
|
+
* | `{ standAt, yawInDegrees? }` | Stand at eye height on the floor, stair, terrain or ground at or below `standAt`, facing `yawInDegrees` (default: current yaw) |
|
|
500
|
+
*
|
|
501
|
+
* Points are plain `{ x, y, z }` world coordinates in `babylon` units.
|
|
502
|
+
*/
|
|
503
|
+
export declare const PluginCameraPoseInput: z.ZodUnion<readonly [z.ZodObject<{
|
|
504
|
+
eye: z.ZodObject<{
|
|
505
|
+
x: z.ZodNumber;
|
|
506
|
+
y: z.ZodNumber;
|
|
507
|
+
z: z.ZodNumber;
|
|
508
|
+
}, z.core.$strip>;
|
|
509
|
+
target: z.ZodObject<{
|
|
510
|
+
x: z.ZodNumber;
|
|
511
|
+
y: z.ZodNumber;
|
|
512
|
+
z: z.ZodNumber;
|
|
513
|
+
}, z.core.$strip>;
|
|
514
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
515
|
+
eye: z.ZodObject<{
|
|
516
|
+
x: z.ZodNumber;
|
|
517
|
+
y: z.ZodNumber;
|
|
518
|
+
z: z.ZodNumber;
|
|
519
|
+
}, z.core.$strip>;
|
|
520
|
+
yawInDegrees: z.ZodNumber;
|
|
521
|
+
pitchInDegrees: z.ZodNumber;
|
|
522
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
523
|
+
standAt: z.ZodObject<{
|
|
524
|
+
x: z.ZodNumber;
|
|
525
|
+
y: z.ZodNumber;
|
|
526
|
+
z: z.ZodNumber;
|
|
527
|
+
}, z.core.$strip>;
|
|
528
|
+
yawInDegrees: z.ZodOptional<z.ZodNumber>;
|
|
529
|
+
}, z.core.$strict>]>;
|
|
530
|
+
export type PluginCameraPoseInput = z.infer<typeof PluginCameraPoseInput>;
|
|
531
|
+
/**
|
|
532
|
+
* Options for {@linkcode PluginCameraApi.setPose}.
|
|
533
|
+
*
|
|
534
|
+
* | Property | Type | Description |
|
|
535
|
+
* |---|---|---|
|
|
536
|
+
* | `durationInSeconds` | `number \| undefined` | Ease to the pose over this long (0 to 10; default 0 jumps) |
|
|
537
|
+
*/
|
|
538
|
+
export declare const PluginCameraSetPoseOptions: z.ZodObject<{
|
|
539
|
+
durationInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
540
|
+
}, z.core.$strict>;
|
|
541
|
+
export type PluginCameraSetPoseOptions = z.infer<typeof PluginCameraSetPoseOptions>;
|
|
542
|
+
/**
|
|
543
|
+
* Arguments for {@linkcode PluginCameraApi.setPose}.
|
|
544
|
+
*/
|
|
545
|
+
export declare const PluginCameraSetPoseArgs: z.ZodObject<{
|
|
546
|
+
pose: z.ZodUnion<readonly [z.ZodObject<{
|
|
547
|
+
eye: z.ZodObject<{
|
|
548
|
+
x: z.ZodNumber;
|
|
549
|
+
y: z.ZodNumber;
|
|
550
|
+
z: z.ZodNumber;
|
|
551
|
+
}, z.core.$strip>;
|
|
552
|
+
target: z.ZodObject<{
|
|
553
|
+
x: z.ZodNumber;
|
|
554
|
+
y: z.ZodNumber;
|
|
555
|
+
z: z.ZodNumber;
|
|
556
|
+
}, z.core.$strip>;
|
|
557
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
558
|
+
eye: z.ZodObject<{
|
|
559
|
+
x: z.ZodNumber;
|
|
560
|
+
y: z.ZodNumber;
|
|
561
|
+
z: z.ZodNumber;
|
|
562
|
+
}, z.core.$strip>;
|
|
563
|
+
yawInDegrees: z.ZodNumber;
|
|
564
|
+
pitchInDegrees: z.ZodNumber;
|
|
565
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
566
|
+
standAt: z.ZodObject<{
|
|
567
|
+
x: z.ZodNumber;
|
|
568
|
+
y: z.ZodNumber;
|
|
569
|
+
z: z.ZodNumber;
|
|
570
|
+
}, z.core.$strip>;
|
|
571
|
+
yawInDegrees: z.ZodOptional<z.ZodNumber>;
|
|
572
|
+
}, z.core.$strict>]>;
|
|
573
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
574
|
+
durationInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
575
|
+
}, z.core.$strict>>;
|
|
576
|
+
}, z.core.$strip>;
|
|
577
|
+
export type PluginCameraSetPoseArgs = z.infer<typeof PluginCameraSetPoseArgs>;
|
|
578
|
+
/**
|
|
579
|
+
* A displacement in the camera's own frame, for {@linkcode PluginCameraApi.move}
|
|
580
|
+
* (`babylon` units; omitted components are 0).
|
|
581
|
+
*
|
|
582
|
+
* | Property | Type | Description |
|
|
583
|
+
* |---|---|---|
|
|
584
|
+
* | `forward` | `number \| undefined` | Along the level view direction (negative walks back) |
|
|
585
|
+
* | `right` | `number \| undefined` | To the camera's right (negative steps left) |
|
|
586
|
+
* | `up` | `number \| undefined` | Vertically (negative descends) |
|
|
587
|
+
*/
|
|
588
|
+
export declare const PluginCameraMoveDisplacement: z.ZodObject<{
|
|
589
|
+
forward: z.ZodOptional<z.ZodNumber>;
|
|
590
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
591
|
+
up: z.ZodOptional<z.ZodNumber>;
|
|
592
|
+
}, z.core.$strict>;
|
|
593
|
+
export type PluginCameraMoveDisplacement = z.infer<typeof PluginCameraMoveDisplacement>;
|
|
594
|
+
/**
|
|
595
|
+
* Options for {@linkcode PluginCameraApi.move}.
|
|
596
|
+
*
|
|
597
|
+
* | Property | Type | Description |
|
|
598
|
+
* |---|---|---|
|
|
599
|
+
* | `followsFloor` | `boolean \| undefined` | Keep the height above the floor, climbing stairs and ramps (default `false`) |
|
|
600
|
+
* | `durationInSeconds` | `number \| undefined` | Walk over this long (0 to 10; default 0 jumps) |
|
|
601
|
+
*/
|
|
602
|
+
export declare const PluginCameraMoveOptions: z.ZodObject<{
|
|
603
|
+
followsFloor: z.ZodOptional<z.ZodBoolean>;
|
|
604
|
+
durationInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
605
|
+
}, z.core.$strict>;
|
|
606
|
+
export type PluginCameraMoveOptions = z.infer<typeof PluginCameraMoveOptions>;
|
|
607
|
+
/**
|
|
608
|
+
* Arguments for {@linkcode PluginCameraApi.move}.
|
|
609
|
+
*/
|
|
610
|
+
export declare const PluginCameraMoveArgs: z.ZodObject<{
|
|
611
|
+
displacement: z.ZodObject<{
|
|
612
|
+
forward: z.ZodOptional<z.ZodNumber>;
|
|
613
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
614
|
+
up: z.ZodOptional<z.ZodNumber>;
|
|
615
|
+
}, z.core.$strict>;
|
|
616
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
617
|
+
followsFloor: z.ZodOptional<z.ZodBoolean>;
|
|
618
|
+
durationInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
619
|
+
}, z.core.$strict>>;
|
|
620
|
+
}, z.core.$strip>;
|
|
621
|
+
export type PluginCameraMoveArgs = z.infer<typeof PluginCameraMoveArgs>;
|
|
622
|
+
/**
|
|
623
|
+
* Options for {@linkcode PluginCameraApi.rotate}.
|
|
624
|
+
*
|
|
625
|
+
* | Property | Type | Description |
|
|
626
|
+
* |---|---|---|
|
|
627
|
+
* | `durationInSeconds` | `number \| undefined` | Turn over this long (0 to 10; default 0 jumps) |
|
|
628
|
+
*/
|
|
629
|
+
export declare const PluginCameraRotateOptions: z.ZodObject<{
|
|
630
|
+
durationInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
631
|
+
}, z.core.$strict>;
|
|
632
|
+
export type PluginCameraRotateOptions = z.infer<typeof PluginCameraRotateOptions>;
|
|
633
|
+
/**
|
|
634
|
+
* Arguments for {@linkcode PluginCameraApi.rotate}.
|
|
635
|
+
*/
|
|
636
|
+
export declare const PluginCameraRotateArgs: z.ZodObject<{
|
|
637
|
+
yawInDegrees: z.ZodNumber;
|
|
638
|
+
pitchInDegrees: z.ZodOptional<z.ZodNumber>;
|
|
639
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
640
|
+
durationInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
641
|
+
}, z.core.$strict>>;
|
|
642
|
+
}, z.core.$strip>;
|
|
643
|
+
export type PluginCameraRotateArgs = z.infer<typeof PluginCameraRotateArgs>;
|
|
644
|
+
/**
|
|
645
|
+
* How fast the arrow keys walk: the Slow / Normal / Fast navigation setting.
|
|
646
|
+
*/
|
|
647
|
+
export declare const PluginCameraWalkSpeed: z.ZodEnum<{
|
|
648
|
+
normal: "normal";
|
|
649
|
+
slow: "slow";
|
|
650
|
+
fast: "fast";
|
|
651
|
+
}>;
|
|
652
|
+
export type PluginCameraWalkSpeed = z.infer<typeof PluginCameraWalkSpeed>;
|
|
653
|
+
/**
|
|
654
|
+
* The arrow-key navigation settings — result of
|
|
655
|
+
* {@linkcode PluginCameraApi.getNavigationSettings} and
|
|
656
|
+
* {@linkcode PluginCameraApi.updateNavigationSettings}.
|
|
657
|
+
*
|
|
658
|
+
* | Property | Type | Description |
|
|
659
|
+
* |---|---|---|
|
|
660
|
+
* | `isKeyboardNavigationEnabled` | `boolean` | Whether the arrow keys walk the camera (Project Settings) |
|
|
661
|
+
* | `eyeHeight` | `number` | Eye height above the floor, `babylon` units |
|
|
662
|
+
* | `walkSpeed` | {@linkcode PluginCameraWalkSpeed} | Arrow-key walking speed |
|
|
663
|
+
* | `isCollisionEnabled` | `boolean` | Whether walking stops at walls |
|
|
664
|
+
*/
|
|
665
|
+
export declare const PluginCameraNavigationSettings: z.ZodObject<{
|
|
666
|
+
isKeyboardNavigationEnabled: z.ZodBoolean;
|
|
667
|
+
eyeHeight: z.ZodNumber;
|
|
668
|
+
walkSpeed: z.ZodEnum<{
|
|
669
|
+
normal: "normal";
|
|
670
|
+
slow: "slow";
|
|
671
|
+
fast: "fast";
|
|
672
|
+
}>;
|
|
673
|
+
isCollisionEnabled: z.ZodBoolean;
|
|
674
|
+
}, z.core.$strip>;
|
|
675
|
+
export type PluginCameraNavigationSettings = z.infer<typeof PluginCameraNavigationSettings>;
|
|
676
|
+
/**
|
|
677
|
+
* The settings to change in {@linkcode PluginCameraApi.updateNavigationSettings};
|
|
678
|
+
* omitted fields keep their value. `eyeHeight` is in `babylon` units, between
|
|
679
|
+
* 0.8 m and 2.5 m (3.15 to 9.84 units).
|
|
680
|
+
*/
|
|
681
|
+
export declare const PluginCameraNavigationSettingsPatch: z.ZodObject<{
|
|
682
|
+
isKeyboardNavigationEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
683
|
+
eyeHeight: z.ZodOptional<z.ZodNumber>;
|
|
684
|
+
walkSpeed: z.ZodOptional<z.ZodEnum<{
|
|
685
|
+
normal: "normal";
|
|
686
|
+
slow: "slow";
|
|
687
|
+
fast: "fast";
|
|
688
|
+
}>>;
|
|
689
|
+
isCollisionEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
+
}, z.core.$strict>;
|
|
691
|
+
export type PluginCameraNavigationSettingsPatch = z.infer<typeof PluginCameraNavigationSettingsPatch>;
|
|
692
|
+
/**
|
|
693
|
+
* Arguments for {@linkcode PluginCameraApi.updateNavigationSettings}.
|
|
694
|
+
*/
|
|
695
|
+
export declare const PluginCameraUpdateNavigationSettingsArgs: z.ZodObject<{
|
|
696
|
+
patch: z.ZodObject<{
|
|
697
|
+
isKeyboardNavigationEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
698
|
+
eyeHeight: z.ZodOptional<z.ZodNumber>;
|
|
699
|
+
walkSpeed: z.ZodOptional<z.ZodEnum<{
|
|
700
|
+
normal: "normal";
|
|
701
|
+
slow: "slow";
|
|
702
|
+
fast: "fast";
|
|
703
|
+
}>>;
|
|
704
|
+
isCollisionEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
705
|
+
}, z.core.$strict>;
|
|
706
|
+
}, z.core.$strip>;
|
|
707
|
+
export type PluginCameraUpdateNavigationSettingsArgs = z.infer<typeof PluginCameraUpdateNavigationSettingsArgs>;
|
|
245
708
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/camera/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CA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