@weasel-js/kernel3d 1.9.3 → 1.10.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/README.md +2 -2
- package/dist/index.d.ts +21 -32
- package/dist/index.js +4 -1516
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ numbers: a 3D host passes the dispatcher an identity `clientToWorld`, so
|
|
|
31
31
|
`ctx.world` is the screen point, and each dep rebuilds the ray itself. Tools,
|
|
32
32
|
the select tool included, transfer untouched.
|
|
33
33
|
|
|
34
|
-
One thing does not
|
|
34
|
+
One thing does not:
|
|
35
35
|
|
|
36
36
|
- **`ViewApi` has no orientation**, so an orbit camera cannot travel through
|
|
37
37
|
the kit's `view`. The kernel declares a `camera3d` dep of its own.
|
|
@@ -46,7 +46,7 @@ away it is.
|
|
|
46
46
|
|
|
47
47
|
**The answer is "as far as it already was."** Both resolve the rectangle on the
|
|
48
48
|
plane through the pose they were handed, facing the camera, so neither changes
|
|
49
|
-
depth. Two consequences
|
|
49
|
+
depth. Two consequences:
|
|
50
50
|
|
|
51
51
|
- A resize scales uniformly. The rectangle names two extents and a pose has
|
|
52
52
|
three, so the factor is the geometric mean of the two it names.
|
package/dist/index.d.ts
CHANGED
|
@@ -140,14 +140,9 @@ declare function projectAabbToScreen(box: Aabb, viewProjection: Mat4, rect: Scre
|
|
|
140
140
|
/**
|
|
141
141
|
* The kit's deps, implemented against a 3D world.
|
|
142
142
|
*
|
|
143
|
-
* Every one of these takes its camera from a thunk rather than an argument
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* each dep already closes over. `InvocationCtx` needs no widening, and none of
|
|
147
|
-
* these needs a ray passed in.
|
|
148
|
-
*
|
|
149
|
-
* Where a kit contract cannot be honored, the implementation throws rather than
|
|
150
|
-
* guessing. A guess would report a fit the kernel does not have.
|
|
143
|
+
* Every one of these takes its camera from a thunk rather than an argument:
|
|
144
|
+
* the dispatcher keeps handing actions two numbers, and what makes them mean
|
|
145
|
+
* something in 3D is the camera each dep already closes over.
|
|
151
146
|
*/
|
|
152
147
|
|
|
153
148
|
/** The camera and the pane it draws into; `width`/`height` are the pane's
|
|
@@ -171,11 +166,9 @@ type Scene3d<TData, TLayer extends string> = Scene<TData, TLayer, Pose3>;
|
|
|
171
166
|
/** A node of a `Scene3d`. */
|
|
172
167
|
type Node3d<TData, TLayer extends string> = SceneNode<TData, TLayer, Pose3>;
|
|
173
168
|
/**
|
|
174
|
-
* The world box a node occupies
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* cube and it widens. Asking for the world box directly is what lets a
|
|
178
|
-
* primitive answer for its own symmetry.
|
|
169
|
+
* The world box a node occupies, rather than a local box to transform: a
|
|
170
|
+
* sphere's box is the same under every rotation, and no transform of a local
|
|
171
|
+
* box reproduces that — rotate a cube and it widens.
|
|
179
172
|
*
|
|
180
173
|
* Omitted, a node is a unit cube carried by its pose.
|
|
181
174
|
*/
|
|
@@ -220,9 +213,9 @@ interface Footprint {
|
|
|
220
213
|
* implies is the consumer's answer — the kernel does not know what it is
|
|
221
214
|
* inserting.
|
|
222
215
|
*
|
|
223
|
-
* The kit's `InsertDep.commit` hands over a screen-space AABB and nothing else
|
|
224
|
-
*
|
|
225
|
-
*
|
|
216
|
+
* The kit's `InsertDep.commit` hands over a screen-space AABB and nothing else:
|
|
217
|
+
* the depth the 2D contract cannot express comes from the plane, not from the
|
|
218
|
+
* caller.
|
|
226
219
|
*/
|
|
227
220
|
declare function createInsert(opts: {
|
|
228
221
|
viewport: ViewportSource;
|
|
@@ -233,33 +226,29 @@ declare function createInsert(opts: {
|
|
|
233
226
|
}): InsertDep;
|
|
234
227
|
/**
|
|
235
228
|
* `PoseDescriptor` over a 3D pose, with `Bounds` read as the screen box the
|
|
236
|
-
* node covers.
|
|
237
|
-
* run the other way cannot.
|
|
229
|
+
* node covers.
|
|
238
230
|
*
|
|
239
|
-
* `forNode` is what lets a sphere bound itself as a sphere:
|
|
240
|
-
* `
|
|
241
|
-
* which one this is. Unspecialized — the kit calling with only a pose in hand —
|
|
231
|
+
* `forNode` is what lets a sphere bound itself as a sphere: the shape lives
|
|
232
|
+
* on `node.data`. Unspecialized — the kit calling with only a pose in hand —
|
|
242
233
|
* it answers with the default local box, which is the looser of the two.
|
|
243
234
|
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* {@link viewPlaneAt}.
|
|
235
|
+
* `remapBounds` and `fromBounds` take a screen rectangle, which names a pose
|
|
236
|
+
* only once something supplies a depth. Both resolve it against the plane
|
|
237
|
+
* through the pose they were handed, facing the camera, so nothing they
|
|
238
|
+
* produce changes depth.
|
|
249
239
|
*/
|
|
250
240
|
declare function createPoseDescriptor<TData, TLayer extends string>(world: World3d<TData, TLayer>): PoseDescriptor<Pose3, Node3d<TData, TLayer>>;
|
|
251
241
|
|
|
252
242
|
/**
|
|
253
243
|
* What a host paints for a gesture that proposes chrome rather than a pose.
|
|
254
244
|
*
|
|
255
|
-
* A marquee sweep and a box-drag both publish an `OngoingOverlay
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* serves a consumer-owned 3D renderer.
|
|
245
|
+
* A marquee sweep and a box-drag both publish an `OngoingOverlay`.
|
|
246
|
+
* `resolveOverlays` hands back world geometry with no renderer in it, so the
|
|
247
|
+
* same call `<SceneCanvas>` makes serves a consumer-owned 3D renderer.
|
|
259
248
|
*
|
|
260
249
|
* A 3D host's `clientToWorld` is identity, so an overlay's world bounds are the
|
|
261
250
|
* client rect the deps already work in, and the pane origin comes off exactly
|
|
262
|
-
* once. Only the rectangular variants resolve here: a lasso, a pencil and a run
|
|
251
|
+
* once. Only the rectangular variants resolve here: a lasso, a pencil, and a run
|
|
263
252
|
* of points are paths, and a path is geometry this cannot flatten to a box.
|
|
264
253
|
*/
|
|
265
254
|
|
|
@@ -287,7 +276,7 @@ declare const orbitAction: Action;
|
|
|
287
276
|
declare const dollyAction: Action;
|
|
288
277
|
/** A tool that binds drag to `camera.orbit`. Register `orbitAction` alongside
|
|
289
278
|
* it; the tool only declares the binding. */
|
|
290
|
-
declare function useOrbitTool(): Tool
|
|
279
|
+
declare function useOrbitTool(): Tool;
|
|
291
280
|
|
|
292
281
|
/**
|
|
293
282
|
* The kernel's one new dep.
|