@opsydyn/effect-three 0.0.0-stage → 0.2.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/CHANGELOG.md +69 -0
- package/LICENSE +21 -0
- package/README.md +189 -2
- package/dist/index-01kwfekm.js +5118 -0
- package/dist/index-01kwfekm.js.map +40 -0
- package/dist/index-4045wme0.js +129 -0
- package/dist/index-4045wme0.js.map +10 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1361 -0
- package/dist/index.js.map +14 -0
- package/dist/kernel/animation.d.ts +14 -0
- package/dist/kernel/animation.d.ts.map +1 -0
- package/dist/kernel/behaviours.d.ts +16 -0
- package/dist/kernel/behaviours.d.ts.map +1 -0
- package/dist/kernel/bodies.d.ts +60 -0
- package/dist/kernel/bodies.d.ts.map +1 -0
- package/dist/kernel/bodySources.d.ts +47 -0
- package/dist/kernel/bodySources.d.ts.map +1 -0
- package/dist/kernel/build.d.ts +564 -0
- package/dist/kernel/build.d.ts.map +1 -0
- package/dist/kernel/cameraMotion.d.ts +39 -0
- package/dist/kernel/cameraMotion.d.ts.map +1 -0
- package/dist/kernel/clock.d.ts +17 -0
- package/dist/kernel/clock.d.ts.map +1 -0
- package/dist/kernel/contactShadowPasses.d.ts +47 -0
- package/dist/kernel/contactShadowPasses.d.ts.map +1 -0
- package/dist/kernel/description.d.ts +1120 -0
- package/dist/kernel/description.d.ts.map +1 -0
- package/dist/kernel/diff.d.ts +90 -0
- package/dist/kernel/diff.d.ts.map +1 -0
- package/dist/kernel/environmentPresets.d.ts +30 -0
- package/dist/kernel/environmentPresets.d.ts.map +1 -0
- package/dist/kernel/equality.d.ts +64 -0
- package/dist/kernel/equality.d.ts.map +1 -0
- package/dist/kernel/frames.d.ts +55 -0
- package/dist/kernel/frames.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +37 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +335 -0
- package/dist/kernel/index.js.map +9 -0
- package/dist/kernel/instances.d.ts +26 -0
- package/dist/kernel/instances.d.ts.map +1 -0
- package/dist/kernel/labels.d.ts +51 -0
- package/dist/kernel/labels.d.ts.map +1 -0
- package/dist/kernel/loop.d.ts +49 -0
- package/dist/kernel/loop.d.ts.map +1 -0
- package/dist/kernel/materials.d.ts +24 -0
- package/dist/kernel/materials.d.ts.map +1 -0
- package/dist/kernel/motion.d.ts +36 -0
- package/dist/kernel/motion.d.ts.map +1 -0
- package/dist/kernel/orbit.d.ts +127 -0
- package/dist/kernel/orbit.d.ts.map +1 -0
- package/dist/kernel/overlays.d.ts +16 -0
- package/dist/kernel/overlays.d.ts.map +1 -0
- package/dist/kernel/performance.d.ts +41 -0
- package/dist/kernel/performance.d.ts.map +1 -0
- package/dist/kernel/physics.d.ts +166 -0
- package/dist/kernel/physics.d.ts.map +1 -0
- package/dist/kernel/physicsDebug.d.ts +18 -0
- package/dist/kernel/physicsDebug.d.ts.map +1 -0
- package/dist/kernel/pointer.d.ts +357 -0
- package/dist/kernel/pointer.d.ts.map +1 -0
- package/dist/kernel/renderKit.d.ts +49 -0
- package/dist/kernel/renderKit.d.ts.map +1 -0
- package/dist/kernel/renderer.d.ts +83 -0
- package/dist/kernel/renderer.d.ts.map +1 -0
- package/dist/kernel/resources.d.ts +112 -0
- package/dist/kernel/resources.d.ts.map +1 -0
- package/dist/kernel/sceneGraph.d.ts +155 -0
- package/dist/kernel/sceneGraph.d.ts.map +1 -0
- package/dist/kernel/sceneIndex.d.ts +90 -0
- package/dist/kernel/sceneIndex.d.ts.map +1 -0
- package/dist/kernel/stage.d.ts +87 -0
- package/dist/kernel/stage.d.ts.map +1 -0
- package/dist/kernel/textLayout.d.ts +29 -0
- package/dist/kernel/textLayout.d.ts.map +1 -0
- package/dist/kernel/tween.d.ts +35 -0
- package/dist/kernel/tween.d.ts.map +1 -0
- package/dist/kernel/xrInput.d.ts +107 -0
- package/dist/kernel/xrInput.d.ts.map +1 -0
- package/dist/kernel/xrLocomotion.d.ts +38 -0
- package/dist/kernel/xrLocomotion.d.ts.map +1 -0
- package/dist/runtime/FrameSource.d.ts +29 -0
- package/dist/runtime/FrameSource.d.ts.map +1 -0
- package/dist/runtime/ResourceRegistry.d.ts +18 -0
- package/dist/runtime/ResourceRegistry.d.ts.map +1 -0
- package/dist/runtime/SceneRuntime.d.ts +68 -0
- package/dist/runtime/SceneRuntime.d.ts.map +1 -0
- package/dist/runtime/SceneSchema.d.ts +2536 -0
- package/dist/runtime/SceneSchema.d.ts.map +1 -0
- package/dist/runtime/errors.d.ts +19 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +11 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/webgl/contactShadows.d.ts +5 -0
- package/dist/webgl/contactShadows.d.ts.map +1 -0
- package/dist/webgl/index.d.ts +11 -0
- package/dist/webgl/index.d.ts.map +1 -0
- package/dist/webgl/index.js +239 -0
- package/dist/webgl/index.js.map +13 -0
- package/dist/webgl/shaderGrid.d.ts +27 -0
- package/dist/webgl/shaderGrid.d.ts.map +1 -0
- package/dist/webgl/sky.d.ts +4 -0
- package/dist/webgl/sky.d.ts.map +1 -0
- package/dist/webgpu/contactShadows.d.ts +5 -0
- package/dist/webgpu/contactShadows.d.ts.map +1 -0
- package/dist/webgpu/index.d.ts +10 -0
- package/dist/webgpu/index.d.ts.map +1 -0
- package/dist/webgpu/index.js +216 -0
- package/dist/webgpu/index.js.map +13 -0
- package/dist/webgpu/shaderGrid.d.ts +5 -0
- package/dist/webgpu/shaderGrid.d.ts.map +1 -0
- package/dist/webgpu/sky.d.ts +4 -0
- package/dist/webgpu/sky.d.ts.map +1 -0
- package/package.json +82 -4
- package/src/index.ts +11 -0
- package/src/kernel/animation.ts +24 -0
- package/src/kernel/behaviours.ts +36 -0
- package/src/kernel/bodies.ts +338 -0
- package/src/kernel/bodySources.ts +203 -0
- package/src/kernel/build.ts +1325 -0
- package/src/kernel/cameraMotion.ts +202 -0
- package/src/kernel/clock.ts +35 -0
- package/src/kernel/contactShadowPasses.ts +207 -0
- package/src/kernel/description.ts +1197 -0
- package/src/kernel/diff.ts +383 -0
- package/src/kernel/environmentPresets.ts +38 -0
- package/src/kernel/equality.ts +604 -0
- package/src/kernel/frames.ts +124 -0
- package/src/kernel/index.ts +274 -0
- package/src/kernel/instances.ts +97 -0
- package/src/kernel/labels.ts +54 -0
- package/src/kernel/loop.ts +248 -0
- package/src/kernel/materials.ts +258 -0
- package/src/kernel/motion.ts +75 -0
- package/src/kernel/orbit.ts +554 -0
- package/src/kernel/overlays.ts +130 -0
- package/src/kernel/performance.ts +101 -0
- package/src/kernel/physics.ts +361 -0
- package/src/kernel/physicsDebug.ts +68 -0
- package/src/kernel/pointer.ts +785 -0
- package/src/kernel/renderKit.ts +54 -0
- package/src/kernel/renderer.ts +136 -0
- package/src/kernel/resources.ts +504 -0
- package/src/kernel/sceneGraph.ts +1442 -0
- package/src/kernel/sceneIndex.ts +219 -0
- package/src/kernel/stage.ts +157 -0
- package/src/kernel/textLayout.ts +102 -0
- package/src/kernel/tween.ts +80 -0
- package/src/kernel/xrInput.ts +230 -0
- package/src/kernel/xrLocomotion.ts +72 -0
- package/src/runtime/FrameSource.ts +41 -0
- package/src/runtime/ResourceRegistry.ts +24 -0
- package/src/runtime/SceneRuntime.ts +229 -0
- package/src/runtime/SceneSchema.ts +983 -0
- package/src/runtime/errors.ts +18 -0
- package/src/runtime/index.ts +10 -0
- package/src/webgl/contactShadows.ts +67 -0
- package/src/webgl/index.ts +19 -0
- package/src/webgl/shaderGrid.ts +196 -0
- package/src/webgl/sky.ts +42 -0
- package/src/webgpu/contactShadows.ts +83 -0
- package/src/webgpu/index.ts +19 -0
- package/src/webgpu/shaderGrid.ts +158 -0
- package/src/webgpu/sky.ts +35 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import {
|
|
2
|
+
handJoints2,
|
|
3
|
+
clipTime2,
|
|
4
|
+
clipRunning2,
|
|
5
|
+
createPose2,
|
|
6
|
+
resetPose2,
|
|
7
|
+
float2,
|
|
8
|
+
builtinBehaviours2,
|
|
9
|
+
spinAngle2,
|
|
10
|
+
writeRotation2,
|
|
11
|
+
buildMaterial2,
|
|
12
|
+
updateMaterial2,
|
|
13
|
+
vec3Equals2,
|
|
14
|
+
rotationEquals2,
|
|
15
|
+
shapeEquals2,
|
|
16
|
+
geometryRefEquals2,
|
|
17
|
+
instanceEquals2,
|
|
18
|
+
instancesEqual2,
|
|
19
|
+
behaviourEquals2,
|
|
20
|
+
animationEquals2,
|
|
21
|
+
transitionEquals2,
|
|
22
|
+
materialRefEquals2,
|
|
23
|
+
cameraEquals2,
|
|
24
|
+
renderSettingsEquals2,
|
|
25
|
+
effectsEqual2,
|
|
26
|
+
viewsEqual2,
|
|
27
|
+
resourcesEqual2,
|
|
28
|
+
overlaysEqual2,
|
|
29
|
+
environmentEquals2,
|
|
30
|
+
skyEquals2,
|
|
31
|
+
contactShadowsEquals2,
|
|
32
|
+
bodyEquals2,
|
|
33
|
+
physicsEquals2,
|
|
34
|
+
xrEquals2,
|
|
35
|
+
capacityFor2,
|
|
36
|
+
createPerformanceMonitor2,
|
|
37
|
+
easeProgress2,
|
|
38
|
+
startTween2,
|
|
39
|
+
applyTween2,
|
|
40
|
+
fixed2,
|
|
41
|
+
spin2,
|
|
42
|
+
box2,
|
|
43
|
+
sphere2,
|
|
44
|
+
plane2,
|
|
45
|
+
cylinder2,
|
|
46
|
+
torus2,
|
|
47
|
+
cone2,
|
|
48
|
+
capsule2,
|
|
49
|
+
ring2,
|
|
50
|
+
circle2,
|
|
51
|
+
text2,
|
|
52
|
+
instant2,
|
|
53
|
+
ease2,
|
|
54
|
+
basic2,
|
|
55
|
+
lambert2,
|
|
56
|
+
phong2,
|
|
57
|
+
standard2,
|
|
58
|
+
physical2,
|
|
59
|
+
normalMaterial2,
|
|
60
|
+
shadowMaterial2,
|
|
61
|
+
grid2,
|
|
62
|
+
shaderGrid2,
|
|
63
|
+
sharedGeometry2,
|
|
64
|
+
lentGeometry2,
|
|
65
|
+
sharedMaterial2,
|
|
66
|
+
group2,
|
|
67
|
+
headSpace2,
|
|
68
|
+
jointSpace2,
|
|
69
|
+
controllerSpace2,
|
|
70
|
+
anchorSpace2,
|
|
71
|
+
planeSpace2,
|
|
72
|
+
meshSpace2,
|
|
73
|
+
xrMeshGeometryId2,
|
|
74
|
+
xrMesh2,
|
|
75
|
+
xrAnchor2,
|
|
76
|
+
mesh2,
|
|
77
|
+
body2,
|
|
78
|
+
interactionGroups2,
|
|
79
|
+
cuboidCollider2,
|
|
80
|
+
ballCollider2,
|
|
81
|
+
capsuleCollider2,
|
|
82
|
+
cylinderCollider2,
|
|
83
|
+
coneCollider2,
|
|
84
|
+
velocityMotor2,
|
|
85
|
+
positionMotor2,
|
|
86
|
+
physics2,
|
|
87
|
+
bodyRef2,
|
|
88
|
+
joint2,
|
|
89
|
+
fixedJoint2,
|
|
90
|
+
sphericalJoint2,
|
|
91
|
+
revoluteJoint2,
|
|
92
|
+
prismaticJoint2,
|
|
93
|
+
ropeJoint2,
|
|
94
|
+
springJoint2,
|
|
95
|
+
glide2,
|
|
96
|
+
xr2,
|
|
97
|
+
instance2,
|
|
98
|
+
instances2,
|
|
99
|
+
behave2,
|
|
100
|
+
play2,
|
|
101
|
+
borrowed2,
|
|
102
|
+
label2,
|
|
103
|
+
colorRange2,
|
|
104
|
+
ambientLight2,
|
|
105
|
+
directionalLight2,
|
|
106
|
+
pointLight2,
|
|
107
|
+
spotLight2,
|
|
108
|
+
hemisphereLight2,
|
|
109
|
+
perspectiveCamera2,
|
|
110
|
+
orthographicCamera2,
|
|
111
|
+
bloom2,
|
|
112
|
+
vignette2,
|
|
113
|
+
film2,
|
|
114
|
+
renderSettings2,
|
|
115
|
+
view2,
|
|
116
|
+
renderTexture2,
|
|
117
|
+
environment2,
|
|
118
|
+
sunPositionFromAngles2,
|
|
119
|
+
sky2,
|
|
120
|
+
contactShadows2,
|
|
121
|
+
overlay2,
|
|
122
|
+
scene2,
|
|
123
|
+
emptyIndex2,
|
|
124
|
+
indexScene2,
|
|
125
|
+
changedFields2,
|
|
126
|
+
diff2,
|
|
127
|
+
createResourceStore2,
|
|
128
|
+
createSceneClock2,
|
|
129
|
+
createManualFrames2,
|
|
130
|
+
createGatedFrames2,
|
|
131
|
+
createFramePacer2,
|
|
132
|
+
defaultOrbit2,
|
|
133
|
+
orbitOptions2,
|
|
134
|
+
rotateCamera2,
|
|
135
|
+
dollyCamera2,
|
|
136
|
+
panCamera2,
|
|
137
|
+
dollyCameraToward2,
|
|
138
|
+
orbit2,
|
|
139
|
+
orbitKey2,
|
|
140
|
+
autoRotated2,
|
|
141
|
+
fitCamera2,
|
|
142
|
+
clipCamera2,
|
|
143
|
+
placeOverlays2,
|
|
144
|
+
interactionBits2,
|
|
145
|
+
colliderFor2,
|
|
146
|
+
describedColliders2,
|
|
147
|
+
collidersFor2,
|
|
148
|
+
colliderSignature2,
|
|
149
|
+
locomote2,
|
|
150
|
+
teleport2,
|
|
151
|
+
glided2,
|
|
152
|
+
createXrTracker2,
|
|
153
|
+
environmentPresets2,
|
|
154
|
+
environmentPresetUrl2,
|
|
155
|
+
stagePresets2,
|
|
156
|
+
stage2,
|
|
157
|
+
centerOffset2,
|
|
158
|
+
stageBounds2,
|
|
159
|
+
noModifiers2,
|
|
160
|
+
pointOnPlane2,
|
|
161
|
+
createPicker2,
|
|
162
|
+
createPointerTracker2,
|
|
163
|
+
createSceneLoop2,
|
|
164
|
+
recordingRendererFactory2,
|
|
165
|
+
createSceneGraph2
|
|
166
|
+
} from "../index-01kwfekm.js";
|
|
167
|
+
export {
|
|
168
|
+
ambientLight2 as ambientLight,
|
|
169
|
+
anchorSpace2 as anchorSpace,
|
|
170
|
+
animationEquals2 as animationEquals,
|
|
171
|
+
applyTween2 as applyTween,
|
|
172
|
+
autoRotated2 as autoRotated,
|
|
173
|
+
ballCollider2 as ballCollider,
|
|
174
|
+
basic2 as basic,
|
|
175
|
+
behave2 as behave,
|
|
176
|
+
behaviourEquals2 as behaviourEquals,
|
|
177
|
+
bloom2 as bloom,
|
|
178
|
+
body2 as body,
|
|
179
|
+
bodyEquals2 as bodyEquals,
|
|
180
|
+
bodyRef2 as bodyRef,
|
|
181
|
+
borrowed2 as borrowed,
|
|
182
|
+
box2 as box,
|
|
183
|
+
buildMaterial2 as buildMaterial,
|
|
184
|
+
builtinBehaviours2 as builtinBehaviours,
|
|
185
|
+
cameraEquals2 as cameraEquals,
|
|
186
|
+
capacityFor2 as capacityFor,
|
|
187
|
+
capsule2 as capsule,
|
|
188
|
+
capsuleCollider2 as capsuleCollider,
|
|
189
|
+
centerOffset2 as centerOffset,
|
|
190
|
+
changedFields2 as changedFields,
|
|
191
|
+
circle2 as circle,
|
|
192
|
+
clipCamera2 as clipCamera,
|
|
193
|
+
clipRunning2 as clipRunning,
|
|
194
|
+
clipTime2 as clipTime,
|
|
195
|
+
colliderFor2 as colliderFor,
|
|
196
|
+
colliderSignature2 as colliderSignature,
|
|
197
|
+
collidersFor2 as collidersFor,
|
|
198
|
+
colorRange2 as colorRange,
|
|
199
|
+
cone2 as cone,
|
|
200
|
+
coneCollider2 as coneCollider,
|
|
201
|
+
contactShadows2 as contactShadows,
|
|
202
|
+
contactShadowsEquals2 as contactShadowsEquals,
|
|
203
|
+
controllerSpace2 as controllerSpace,
|
|
204
|
+
createFramePacer2 as createFramePacer,
|
|
205
|
+
createGatedFrames2 as createGatedFrames,
|
|
206
|
+
createManualFrames2 as createManualFrames,
|
|
207
|
+
createPerformanceMonitor2 as createPerformanceMonitor,
|
|
208
|
+
createPicker2 as createPicker,
|
|
209
|
+
createPointerTracker2 as createPointerTracker,
|
|
210
|
+
createPose2 as createPose,
|
|
211
|
+
createResourceStore2 as createResourceStore,
|
|
212
|
+
createSceneClock2 as createSceneClock,
|
|
213
|
+
createSceneGraph2 as createSceneGraph,
|
|
214
|
+
createSceneLoop2 as createSceneLoop,
|
|
215
|
+
createXrTracker2 as createXrTracker,
|
|
216
|
+
cuboidCollider2 as cuboidCollider,
|
|
217
|
+
cylinder2 as cylinder,
|
|
218
|
+
cylinderCollider2 as cylinderCollider,
|
|
219
|
+
defaultOrbit2 as defaultOrbit,
|
|
220
|
+
describedColliders2 as describedColliders,
|
|
221
|
+
diff2 as diff,
|
|
222
|
+
directionalLight2 as directionalLight,
|
|
223
|
+
dollyCamera2 as dollyCamera,
|
|
224
|
+
dollyCameraToward2 as dollyCameraToward,
|
|
225
|
+
ease2 as ease,
|
|
226
|
+
easeProgress2 as easeProgress,
|
|
227
|
+
effectsEqual2 as effectsEqual,
|
|
228
|
+
emptyIndex2 as emptyIndex,
|
|
229
|
+
environment2 as environment,
|
|
230
|
+
environmentEquals2 as environmentEquals,
|
|
231
|
+
environmentPresetUrl2 as environmentPresetUrl,
|
|
232
|
+
environmentPresets2 as environmentPresets,
|
|
233
|
+
film2 as film,
|
|
234
|
+
fitCamera2 as fitCamera,
|
|
235
|
+
fixed2 as fixed,
|
|
236
|
+
fixedJoint2 as fixedJoint,
|
|
237
|
+
float2 as float,
|
|
238
|
+
geometryRefEquals2 as geometryRefEquals,
|
|
239
|
+
glide2 as glide,
|
|
240
|
+
glided2 as glided,
|
|
241
|
+
grid2 as grid,
|
|
242
|
+
group2 as group,
|
|
243
|
+
handJoints2 as handJoints,
|
|
244
|
+
headSpace2 as headSpace,
|
|
245
|
+
hemisphereLight2 as hemisphereLight,
|
|
246
|
+
indexScene2 as indexScene,
|
|
247
|
+
instance2 as instance,
|
|
248
|
+
instanceEquals2 as instanceEquals,
|
|
249
|
+
instances2 as instances,
|
|
250
|
+
instancesEqual2 as instancesEqual,
|
|
251
|
+
instant2 as instant,
|
|
252
|
+
interactionBits2 as interactionBits,
|
|
253
|
+
interactionGroups2 as interactionGroups,
|
|
254
|
+
joint2 as joint,
|
|
255
|
+
jointSpace2 as jointSpace,
|
|
256
|
+
label2 as label,
|
|
257
|
+
lambert2 as lambert,
|
|
258
|
+
lentGeometry2 as lentGeometry,
|
|
259
|
+
locomote2 as locomote,
|
|
260
|
+
materialRefEquals2 as materialRefEquals,
|
|
261
|
+
mesh2 as mesh,
|
|
262
|
+
meshSpace2 as meshSpace,
|
|
263
|
+
noModifiers2 as noModifiers,
|
|
264
|
+
normalMaterial2 as normalMaterial,
|
|
265
|
+
orbit2 as orbit,
|
|
266
|
+
orbitKey2 as orbitKey,
|
|
267
|
+
orbitOptions2 as orbitOptions,
|
|
268
|
+
orthographicCamera2 as orthographicCamera,
|
|
269
|
+
overlay2 as overlay,
|
|
270
|
+
overlaysEqual2 as overlaysEqual,
|
|
271
|
+
panCamera2 as panCamera,
|
|
272
|
+
perspectiveCamera2 as perspectiveCamera,
|
|
273
|
+
phong2 as phong,
|
|
274
|
+
physical2 as physical,
|
|
275
|
+
physics2 as physics,
|
|
276
|
+
physicsEquals2 as physicsEquals,
|
|
277
|
+
placeOverlays2 as placeOverlays,
|
|
278
|
+
plane2 as plane,
|
|
279
|
+
planeSpace2 as planeSpace,
|
|
280
|
+
play2 as play,
|
|
281
|
+
pointLight2 as pointLight,
|
|
282
|
+
pointOnPlane2 as pointOnPlane,
|
|
283
|
+
positionMotor2 as positionMotor,
|
|
284
|
+
prismaticJoint2 as prismaticJoint,
|
|
285
|
+
recordingRendererFactory2 as recordingRendererFactory,
|
|
286
|
+
renderSettings2 as renderSettings,
|
|
287
|
+
renderSettingsEquals2 as renderSettingsEquals,
|
|
288
|
+
renderTexture2 as renderTexture,
|
|
289
|
+
resetPose2 as resetPose,
|
|
290
|
+
resourcesEqual2 as resourcesEqual,
|
|
291
|
+
revoluteJoint2 as revoluteJoint,
|
|
292
|
+
ring2 as ring,
|
|
293
|
+
ropeJoint2 as ropeJoint,
|
|
294
|
+
rotateCamera2 as rotateCamera,
|
|
295
|
+
rotationEquals2 as rotationEquals,
|
|
296
|
+
scene2 as scene,
|
|
297
|
+
shaderGrid2 as shaderGrid,
|
|
298
|
+
shadowMaterial2 as shadowMaterial,
|
|
299
|
+
shapeEquals2 as shapeEquals,
|
|
300
|
+
sharedGeometry2 as sharedGeometry,
|
|
301
|
+
sharedMaterial2 as sharedMaterial,
|
|
302
|
+
sky2 as sky,
|
|
303
|
+
skyEquals2 as skyEquals,
|
|
304
|
+
sphere2 as sphere,
|
|
305
|
+
sphericalJoint2 as sphericalJoint,
|
|
306
|
+
spin2 as spin,
|
|
307
|
+
spinAngle2 as spinAngle,
|
|
308
|
+
spotLight2 as spotLight,
|
|
309
|
+
springJoint2 as springJoint,
|
|
310
|
+
stage2 as stage,
|
|
311
|
+
stageBounds2 as stageBounds,
|
|
312
|
+
stagePresets2 as stagePresets,
|
|
313
|
+
standard2 as standard,
|
|
314
|
+
startTween2 as startTween,
|
|
315
|
+
sunPositionFromAngles2 as sunPositionFromAngles,
|
|
316
|
+
teleport2 as teleport,
|
|
317
|
+
text2 as text,
|
|
318
|
+
torus2 as torus,
|
|
319
|
+
transitionEquals2 as transitionEquals,
|
|
320
|
+
updateMaterial2 as updateMaterial,
|
|
321
|
+
vec3Equals2 as vec3Equals,
|
|
322
|
+
velocityMotor2 as velocityMotor,
|
|
323
|
+
view2 as view,
|
|
324
|
+
viewsEqual2 as viewsEqual,
|
|
325
|
+
vignette2 as vignette,
|
|
326
|
+
writeRotation2 as writeRotation,
|
|
327
|
+
xr2 as xr,
|
|
328
|
+
xrAnchor2 as xrAnchor,
|
|
329
|
+
xrEquals2 as xrEquals,
|
|
330
|
+
xrMesh2 as xrMesh,
|
|
331
|
+
xrMeshGeometryId2 as xrMeshGeometryId
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
//# debugId=0E05A0594250FA0164756E2164756E21
|
|
335
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writing instance descriptions into three.js's `InstancedMesh` buffers.
|
|
3
|
+
*
|
|
4
|
+
* Slots are positional: instance `i` of the description lives in slot `i`. An update
|
|
5
|
+
* writes only the slots whose instance changed, so moving one of 10,000 instances writes
|
|
6
|
+
* one matrix. Capacity grows by doubling, so adding instances rarely reallocates.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type BufferGeometry, InstancedMesh } from 'three';
|
|
11
|
+
import type { Instance } from './description.ts';
|
|
12
|
+
import type { HostMaterial } from './materials.ts';
|
|
13
|
+
/** The three.js object an `instances` node is hosted as. */
|
|
14
|
+
export type HostInstances = InstancedMesh<BufferGeometry, HostMaterial>;
|
|
15
|
+
/** Slots to allocate for `count` instances: the next power of two, at least 16. */
|
|
16
|
+
export declare const capacityFor: (count: number) => number;
|
|
17
|
+
/** Creates an instanced mesh with room for at least `count` instances. */
|
|
18
|
+
export declare const createInstances: (geometry: BufferGeometry, material: HostMaterial, count: number) => HostInstances;
|
|
19
|
+
/** Whether `count` instances fit without reallocating. */
|
|
20
|
+
export declare const fits: (mesh: HostInstances, count: number) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Writes `next` into `mesh`, skipping slots whose instance is unchanged from `previous`
|
|
23
|
+
* (pass an empty list to write every slot). `next` must fit. Returns the slots written.
|
|
24
|
+
*/
|
|
25
|
+
export declare const writeInstances: (mesh: HostInstances, previous: ReadonlyArray<Instance>, next: ReadonlyArray<Instance>) => number;
|
|
26
|
+
//# sourceMappingURL=instances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/kernel/instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,KAAK,cAAc,EAInB,aAAa,EAId,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAIxE,mFAAmF;AACnF,eAAO,MAAM,WAAW,UAAW,MAAM,KAAG,MAC8B,CAAC;AAmB3E,0EAA0E;AAC1E,eAAO,MAAM,eAAe,aAChB,cAAc,YACd,YAAY,SACf,MAAM,KACZ,aAQF,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,IAAI,SAAU,aAAa,SAAS,MAAM,KAAG,OACtB,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,cAAc,SACnB,aAAa,YACT,aAAa,CAAC,QAAQ,CAAC,QAC3B,aAAa,CAAC,QAAQ,CAAC,KAC5B,MAmBF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kernel's side of labels (distance-field text): an engine-neutral contract. An
|
|
3
|
+
* engine package (troika, in `@opsydyn/effect-three-troika`) implements `LabelEngine`; the
|
|
4
|
+
* scene graph hosts what it makes inside each label's wrapper.
|
|
5
|
+
*
|
|
6
|
+
* Behavioural reference: Drei's `Text` at `bf6f4ad` (`src/core/Text.tsx`): a troika mesh
|
|
7
|
+
* per label, its properties set from props, `sync` run after each change and the frame
|
|
8
|
+
* invalidated when it finishes, and the mesh disposed on unmount.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import type { Material, Object3D } from 'three';
|
|
13
|
+
import type { LabelNode } from './description.ts';
|
|
14
|
+
/**
|
|
15
|
+
* A label's laid-out size in its own units (before its scale), each as
|
|
16
|
+
* `[minX, minY, maxX, maxY]`: `block` the whole text block, line height included, and
|
|
17
|
+
* `visible` tight round the glyphs (troika's `blockBounds` and `visibleBounds`).
|
|
18
|
+
*/
|
|
19
|
+
export type LabelLayout = {
|
|
20
|
+
readonly block: readonly [number, number, number, number];
|
|
21
|
+
readonly visible: readonly [number, number, number, number];
|
|
22
|
+
};
|
|
23
|
+
/** One label as an engine draws it. */
|
|
24
|
+
export type HostedLabel = {
|
|
25
|
+
/** What to show inside the label's wrapper. */
|
|
26
|
+
readonly object: Object3D;
|
|
27
|
+
/** Applies new text or type settings; `ready` is called again when they are drawn. */
|
|
28
|
+
readonly update: (label: LabelNode) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Draws the glyphs with a material the scene lends (`label({ material })`), or the
|
|
31
|
+
* engine's own with `undefined`. The scene owns it: the engine never disposes it.
|
|
32
|
+
*/
|
|
33
|
+
readonly setMaterial: (material: Material | undefined) => void;
|
|
34
|
+
/** The text's laid-out size, once it has been laid out. */
|
|
35
|
+
readonly layout: () => LabelLayout | undefined;
|
|
36
|
+
readonly dispose: () => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Draws labels. `ready` is called whenever a label's glyphs have been built (fonts load
|
|
40
|
+
* and glyphs build in the background), so the scene can draw again.
|
|
41
|
+
*/
|
|
42
|
+
export type LabelEngine = {
|
|
43
|
+
/** A label drawn with WebGL's own materials, for a `'webgl'` render kit. */
|
|
44
|
+
readonly create: (label: LabelNode, ready: () => void) => HostedLabel;
|
|
45
|
+
/**
|
|
46
|
+
* A label drawn with three's node materials (TSL), for a `'tsl'` render kit such as
|
|
47
|
+
* `WebGPURenderer`'s. Without it, those renderers draw no labels.
|
|
48
|
+
*/
|
|
49
|
+
readonly createTsl?: (label: LabelNode, ready: () => void) => HostedLabel;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/kernel/labels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7D,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,WAAW,GAAG;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;IACtE;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;CAC3E,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type OverlayPlacement } from './overlays.ts';
|
|
2
|
+
import { type PerformanceOptions } from './performance.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The per-frame step and pointer routing for one scene. Plain synchronous code: the
|
|
5
|
+
* Effect runtime owns its lifetime (ADR-003: Effect owns lifetimes, not frames).
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { type PointerInput, type SceneEvent } from './pointer.ts';
|
|
10
|
+
import type { SceneRenderer } from './renderer.ts';
|
|
11
|
+
import type { SceneGraph } from './sceneGraph.ts';
|
|
12
|
+
import { type XrInput } from './xrInput.ts';
|
|
13
|
+
export type SceneLoopOptions = {
|
|
14
|
+
readonly graph: SceneGraph;
|
|
15
|
+
readonly renderer: SceneRenderer;
|
|
16
|
+
/** Scene time in seconds. Behaviours are a pure function of it. */
|
|
17
|
+
readonly elapsedSeconds: () => number;
|
|
18
|
+
/** Receives every scene event. Must not throw. */
|
|
19
|
+
readonly emit: (event: SceneEvent) => void;
|
|
20
|
+
/** Wall-clock milliseconds, for the frame-rate monitor. Defaults to `Date.now`. */
|
|
21
|
+
readonly now?: () => number;
|
|
22
|
+
/** Tuning for the frame-rate monitor. */
|
|
23
|
+
readonly performance?: PerformanceOptions;
|
|
24
|
+
/**
|
|
25
|
+
* Receives where the scene's overlays are after each drawn frame, for the host to move
|
|
26
|
+
* their HTML there; once with none after the last overlay goes. Must not throw.
|
|
27
|
+
*/
|
|
28
|
+
readonly placeOverlays?: (placements: ReadonlyArray<OverlayPlacement>) => void;
|
|
29
|
+
};
|
|
30
|
+
export type SceneLoop = {
|
|
31
|
+
/** Advances behaviours, re-tests hover and renders one frame. */
|
|
32
|
+
readonly frame: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Whether frames should keep coming: always in `always` mode, while the graph needs one
|
|
35
|
+
* in `demand` mode, never in `never` mode (frames then come only from `advance`).
|
|
36
|
+
*/
|
|
37
|
+
readonly wantsFrames: () => boolean;
|
|
38
|
+
/** Releases the render textures' targets and withdraws their textures. */
|
|
39
|
+
readonly dispose: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Routes pointer input to hit testing, emits the resulting events and returns them, so
|
|
42
|
+
* a DOM listener can decide synchronously whether the scene handled its event.
|
|
43
|
+
*/
|
|
44
|
+
readonly pointer: (input: PointerInput) => ReadonlyArray<SceneEvent>;
|
|
45
|
+
/** Routes XR input (aims, selects, sticks, buttons, surfaces), emitting the events. */
|
|
46
|
+
readonly xrInput: (input: XrInput) => ReadonlyArray<SceneEvent>;
|
|
47
|
+
};
|
|
48
|
+
export declare const createSceneLoop: (options: SceneLoopOptions) => SceneLoop;
|
|
49
|
+
//# sourceMappingURL=loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/kernel/loop.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,eAAe,CAAC;AACrE,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACrF;;;;;GAKG;AACH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,mEAAmE;IACnE,QAAQ,CAAC,cAAc,EAAE,MAAM,MAAM,CAAC;IACtC,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,mFAAmF;IACnF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC;IACrE,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC;CACjE,CAAC;AAKF,eAAO,MAAM,eAAe,YAAa,gBAAgB,KAAG,SAyL3D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Building and updating three.js materials from descriptions.
|
|
3
|
+
*
|
|
4
|
+
* Kinds and defaults follow three.js's mesh materials (`three/src/materials`). A change
|
|
5
|
+
* within one kind is applied in place; when it touches something compiled into the shader
|
|
6
|
+
* (transparency, side, flat shading) the material is flagged for recompilation, as three
|
|
7
|
+
* requires. A change of kind needs a new material, which the resource store handles.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { MeshBasicMaterial, MeshLambertMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, ShadowMaterial as ThreeShadowMaterial, type Texture } from 'three';
|
|
12
|
+
import type { SurfaceMaterial } from './description.ts';
|
|
13
|
+
/** Looks up a texture lent to the store. */
|
|
14
|
+
export type Textures = (id: string) => Texture | undefined;
|
|
15
|
+
/** The three.js material kinds the kernel hosts. */
|
|
16
|
+
export type HostMaterial = MeshBasicMaterial | MeshLambertMaterial | MeshPhongMaterial | MeshStandardMaterial | MeshPhysicalMaterial | MeshNormalMaterial | ThreeShadowMaterial;
|
|
17
|
+
/** Builds a new material for a description. */
|
|
18
|
+
export declare const buildMaterial: (description: SurfaceMaterial, textures?: Textures) => HostMaterial;
|
|
19
|
+
/**
|
|
20
|
+
* Applies a description to an existing material in place. Returns `false`, changing
|
|
21
|
+
* nothing, when the material is a different kind: the caller must build a new one.
|
|
22
|
+
*/
|
|
23
|
+
export declare const updateMaterial: (material: HostMaterial, description: SurfaceMaterial, textures?: Textures) => boolean;
|
|
24
|
+
//# sourceMappingURL=materials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materials.d.ts","sourceRoot":"","sources":["../../src/kernel/materials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAIL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,IAAI,mBAAmB,EAErC,KAAK,OAAO,EACb,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EASV,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,4CAA4C;AAC5C,MAAM,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC;AAgB3D,oDAAoD;AACpD,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,CAAC;AA6GxB,+CAA+C;AAC/C,eAAO,MAAM,aAAa,gBACX,eAAe,aAClB,QAAQ,KACjB,YAsCF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,aACf,YAAY,eACT,eAAe,aAClB,QAAQ,KACjB,OAkCF,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registered behaviours: application motion as pure functions of scene time.
|
|
3
|
+
*
|
|
4
|
+
* A behaviour writes a pose (a position offset, a rotation and a scale factor) into a
|
|
5
|
+
* reused scratch value, so ticking allocates nothing. The scene graph composes that pose
|
|
6
|
+
* on top of the node's own transform each frame: position added, rotation added, scale
|
|
7
|
+
* multiplied. Because the pose depends only on time and parameters, behaviours pause,
|
|
8
|
+
* rewind and replay with the scene, unlike `useFrame` callbacks that mutate state.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import { Vector3 } from 'three';
|
|
13
|
+
/** Where a behaviour writes its pose. Reset to no change before every call. */
|
|
14
|
+
export type BehaviourPose = {
|
|
15
|
+
/** Added to the node's position, in its parent's space. */
|
|
16
|
+
readonly offset: Vector3;
|
|
17
|
+
/** Euler angles (radians) added to the node's rotation. */
|
|
18
|
+
readonly rotation: Vector3;
|
|
19
|
+
/** Multiplies the node's scale. */
|
|
20
|
+
readonly scale: Vector3;
|
|
21
|
+
};
|
|
22
|
+
/** A behaviour: writes the pose for `seconds` of scene time and the node's parameters. */
|
|
23
|
+
export type Behaviour = (pose: BehaviourPose, seconds: number, params: Readonly<Record<string, number>>) => void;
|
|
24
|
+
/** A pose that changes nothing. */
|
|
25
|
+
export declare const createPose: () => BehaviourPose;
|
|
26
|
+
export declare const resetPose: (pose: BehaviourPose) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Drei's `Float` (`drei-main/src/core/Float.tsx` at `bf6f4ad`): a gentle bob and sway.
|
|
29
|
+
* Parameters (Drei's defaults): `speed` 1, `rotationIntensity` 1, `floatIntensity` 1,
|
|
30
|
+
* `low` -0.1 and `high` 0.1 (Drei's `floatingRange`), and `phase` 0 in place of Drei's
|
|
31
|
+
* random start, so the motion is the same on every run.
|
|
32
|
+
*/
|
|
33
|
+
export declare const float: Behaviour;
|
|
34
|
+
/** Behaviours every scene knows without registering them. */
|
|
35
|
+
export declare const builtinBehaviours: Readonly<Record<string, Behaviour>>;
|
|
36
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/kernel/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GAAG;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,0FAA0F;AAC1F,MAAM,MAAM,SAAS,GAAG,CACtB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KACrC,IAAI,CAAC;AAEV,mCAAmC;AACnC,eAAO,MAAM,UAAU,QAAO,aAI5B,CAAC;AAEH,eAAO,MAAM,SAAS,SAAU,aAAa,KAAG,IAI/C,CAAC;AAMF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,SAkBnB,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAa,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { Camera, Vec3 } from './description.ts';
|
|
2
|
+
import type { Gesture, Modifiers } from './pointer.ts';
|
|
3
|
+
/** How `orbit` reads gestures: speeds and limits, as three.js's `OrbitControls`. */
|
|
4
|
+
export type OrbitOptions = {
|
|
5
|
+
readonly enableRotate: boolean;
|
|
6
|
+
readonly enableZoom: boolean;
|
|
7
|
+
readonly enablePan: boolean;
|
|
8
|
+
readonly rotateSpeed: number;
|
|
9
|
+
readonly zoomSpeed: number;
|
|
10
|
+
readonly panSpeed: number;
|
|
11
|
+
/** Pan in the screen's plane (`true`, the default) or along the ground (`false`). */
|
|
12
|
+
readonly screenSpacePanning: boolean;
|
|
13
|
+
/** Perspective cameras: the closest and furthest distance from the target. */
|
|
14
|
+
readonly minDistance: number;
|
|
15
|
+
readonly maxDistance: number;
|
|
16
|
+
/** Orthographic cameras: the smallest and largest `zoom`. */
|
|
17
|
+
readonly minZoom: number;
|
|
18
|
+
readonly maxZoom: number;
|
|
19
|
+
/** Radians from straight above (0) to straight below (π). */
|
|
20
|
+
readonly minPolarAngle: number;
|
|
21
|
+
readonly maxPolarAngle: number;
|
|
22
|
+
/** Radians around the vertical axis; infinite (the default) for no limit. */
|
|
23
|
+
readonly minAzimuthAngle: number;
|
|
24
|
+
readonly maxAzimuthAngle: number;
|
|
25
|
+
/** Dolly toward the point under the pointer rather than the target (`zoomToCursor`). */
|
|
26
|
+
readonly zoomToCursor: boolean;
|
|
27
|
+
/** Pixels an arrow key pans by, and turns an arrow key with a modifier makes. */
|
|
28
|
+
readonly keyPanSpeed: number;
|
|
29
|
+
readonly keyRotateSpeed: number;
|
|
30
|
+
};
|
|
31
|
+
/** three.js's `OrbitControls` defaults. */
|
|
32
|
+
export declare const defaultOrbit: OrbitOptions;
|
|
33
|
+
/** Orbit options: three.js's defaults with yours on top. */
|
|
34
|
+
export declare const orbitOptions: (options?: Partial<OrbitOptions>) => OrbitOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Turns the camera round its target by a drag of `deltaX`, `deltaY` CSS pixels over an
|
|
37
|
+
* area `height` pixels tall: a drag the full height turns it once round.
|
|
38
|
+
*/
|
|
39
|
+
export declare const rotateCamera: (camera: Camera, deltaX: number, deltaY: number, height: number, options?: OrbitOptions) => Camera;
|
|
40
|
+
/**
|
|
41
|
+
* Scales the camera's distance from its target by `scale` (below 1 moves closer). An
|
|
42
|
+
* orthographic camera keeps its distance and divides its `zoom` by `scale` instead.
|
|
43
|
+
*/
|
|
44
|
+
export declare const dollyCamera: (camera: Camera, scale: number, options?: OrbitOptions) => Camera;
|
|
45
|
+
/**
|
|
46
|
+
* Moves the camera and its target together by a drag of `deltaX`, `deltaY` CSS pixels
|
|
47
|
+
* over an area `width` by `height`: the scene follows the pointer at the target's depth.
|
|
48
|
+
*/
|
|
49
|
+
export declare const panCamera: (camera: Camera, deltaX: number, deltaY: number, area: {
|
|
50
|
+
readonly width: number;
|
|
51
|
+
readonly height: number;
|
|
52
|
+
}, options?: OrbitOptions) => Camera;
|
|
53
|
+
/** Where on a gesture's area the pointer is: its size, and `x`, `y` from −1 to 1, y up. */
|
|
54
|
+
export type Cursor = {
|
|
55
|
+
readonly width: number;
|
|
56
|
+
readonly height: number;
|
|
57
|
+
readonly x: number;
|
|
58
|
+
readonly y: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Dollies toward the point under the cursor by `scale` (below 1 moves closer), as
|
|
62
|
+
* OrbitControls does with `zoomToCursor`: a perspective camera moves along the pointer's
|
|
63
|
+
* ray; an orthographic one zooms and shifts so the point under the cursor stays there.
|
|
64
|
+
* The target then follows, `radius` ahead along the view (or on the ground, when panning
|
|
65
|
+
* along it and the view is not too steep). A middle-button drag aims where it was
|
|
66
|
+
* pressed: three 0.186's `_handleMouseDownDolly` passes `clientX` for both coordinates, a
|
|
67
|
+
* typo this does not copy.
|
|
68
|
+
*/
|
|
69
|
+
export declare const dollyCameraToward: (camera: Camera, scale: number, cursor: Cursor, options?: OrbitOptions) => Camera;
|
|
70
|
+
/**
|
|
71
|
+
* The camera after one gesture, as three.js's `OrbitControls` would move it. Apply it in
|
|
72
|
+
* `update` and keep the result in the Model:
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* GotGesture: ({ gesture }) => ({ model: { ...model, camera: orbit(model.camera, gesture) } })
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* A wheel with control held (how trackpads report a pinch) dollies ten times as far.
|
|
79
|
+
*/
|
|
80
|
+
export declare const orbit: (camera: Camera, gesture: Gesture, options?: OrbitOptions) => Camera;
|
|
81
|
+
/** The arrow keys OrbitControls listens to (`keys`). */
|
|
82
|
+
export type OrbitKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
|
|
83
|
+
/**
|
|
84
|
+
* The camera after an arrow key, as OrbitControls' `_handleKeyDown`: up, down, left and
|
|
85
|
+
* right pan by `keyPanSpeed` pixels, or with shift, control or meta held turn by
|
|
86
|
+
* `keyRotateSpeed`. Map key presses to Messages (a Foldkit key subscription) and apply it.
|
|
87
|
+
*/
|
|
88
|
+
export declare const orbitKey: (camera: Camera, key: OrbitKey, modifiers: Modifiers, area: {
|
|
89
|
+
readonly width: number;
|
|
90
|
+
readonly height: number;
|
|
91
|
+
}, options?: OrbitOptions) => Camera;
|
|
92
|
+
/** A world-space box, as `Measured` events report a node's. */
|
|
93
|
+
export type Box = {
|
|
94
|
+
readonly min: Vec3;
|
|
95
|
+
readonly max: Vec3;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The camera where turning by itself (`autoRotate`) took it, from an `AutoRotated`
|
|
99
|
+
* event: keep it in the Model before orbiting, so the gesture goes on from where the
|
|
100
|
+
* camera was shown.
|
|
101
|
+
*
|
|
102
|
+
* ```ts
|
|
103
|
+
* AutoRotated: ({ position }) => ({ model: { ...model, camera: autoRotated(model.camera, { position }) } })
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare const autoRotated: <C extends Camera>(camera: C, turned: {
|
|
107
|
+
readonly position: Vec3;
|
|
108
|
+
}) => C;
|
|
109
|
+
/**
|
|
110
|
+
* The camera framing a box, as Drei's `Bounds` `fit` (margin 1.2 by default). A
|
|
111
|
+
* perspective camera keeps its direction and moves to the distance that fits the box,
|
|
112
|
+
* looking at its centre; an orthographic one keeps its place and zooms so the box's
|
|
113
|
+
* corners, seen from it, fit the area. Set the camera's `damping` to ease there.
|
|
114
|
+
*/
|
|
115
|
+
export declare const fitCamera: (camera: Camera, box: Box, area: {
|
|
116
|
+
readonly width: number;
|
|
117
|
+
readonly height: number;
|
|
118
|
+
}, margin?: number) => Camera;
|
|
119
|
+
/**
|
|
120
|
+
* Near and far planes that suit a box at its fitting distance, as Drei's `Bounds` `clip`:
|
|
121
|
+
* a hundredth of it and a hundred times it.
|
|
122
|
+
*/
|
|
123
|
+
export declare const clipCamera: (camera: Camera, box: Box, area: {
|
|
124
|
+
readonly width: number;
|
|
125
|
+
readonly height: number;
|
|
126
|
+
}, margin?: number) => Camera;
|
|
127
|
+
//# sourceMappingURL=orbit.d.ts.map
|