@pmndrs/klipp 0.0.0-stage → 0.14.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.
Files changed (270) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -2
  3. package/dist/_virtual/_rolldown/runtime.js +13 -0
  4. package/dist/core/CameraState.d.ts +32 -0
  5. package/dist/core/CameraState.js +97 -0
  6. package/dist/core/EventDispatcher.d.ts +18 -0
  7. package/dist/core/EventDispatcher.js +28 -0
  8. package/dist/core/Klipp.d.ts +109 -0
  9. package/dist/core/Klipp.js +253 -0
  10. package/dist/core/TargetExtent.d.ts +11 -0
  11. package/dist/core/TargetExtent.js +54 -0
  12. package/dist/core/TargetPose.d.ts +13 -0
  13. package/dist/core/TargetPose.js +21 -0
  14. package/dist/core/VirtualCamera.d.ts +102 -0
  15. package/dist/core/VirtualCamera.js +290 -0
  16. package/dist/core/aim/HardLookAtAim.d.ts +10 -0
  17. package/dist/core/aim/HardLookAtAim.js +19 -0
  18. package/dist/core/aim/PanTiltAim.d.ts +26 -0
  19. package/dist/core/aim/PanTiltAim.js +38 -0
  20. package/dist/core/aim/RotateWithFollowTargetAim.d.ts +19 -0
  21. package/dist/core/aim/RotateWithFollowTargetAim.js +23 -0
  22. package/dist/core/aim/RotationComposerAim.d.ts +27 -0
  23. package/dist/core/aim/RotationComposerAim.js +27 -0
  24. package/dist/core/aim/hardLookAt.d.ts +4 -0
  25. package/dist/core/aim/hardLookAt.js +13 -0
  26. package/dist/core/aim/index.d.ts +11 -0
  27. package/dist/core/aim/lookRotation.d.ts +6 -0
  28. package/dist/core/aim/lookRotation.js +46 -0
  29. package/dist/core/aim/panTilt.d.ts +16 -0
  30. package/dist/core/aim/panTilt.js +121 -0
  31. package/dist/core/aim/rotateWithFollowTarget.d.ts +20 -0
  32. package/dist/core/aim/rotateWithFollowTarget.js +35 -0
  33. package/dist/core/aim/rotationComposer.d.ts +58 -0
  34. package/dist/core/aim/rotationComposer.js +284 -0
  35. package/dist/core/blend/BlendCurves.d.ts +19 -0
  36. package/dist/core/blend/BlendCurves.js +22 -0
  37. package/dist/core/blend/BlendDefinition.d.ts +21 -0
  38. package/dist/core/blend/BlendDefinition.js +9 -0
  39. package/dist/core/blend/BlendDriver.d.ts +23 -0
  40. package/dist/core/blend/BlendDriver.js +42 -0
  41. package/dist/core/blend/BlendHints.d.ts +9 -0
  42. package/dist/core/blend/BlendHints.js +13 -0
  43. package/dist/core/blend/blend.d.ts +41 -0
  44. package/dist/core/blend/blend.js +110 -0
  45. package/dist/core/blend/index.d.ts +6 -0
  46. package/dist/core/blend/lerpCameraState.d.ts +4 -0
  47. package/dist/core/blend/lerpCameraState.js +143 -0
  48. package/dist/core/body/BindingModes.d.ts +9 -0
  49. package/dist/core/body/BindingModes.js +11 -0
  50. package/dist/core/body/FollowBody.d.ts +24 -0
  51. package/dist/core/body/FollowBody.js +26 -0
  52. package/dist/core/body/HardLockToTargetBody.d.ts +17 -0
  53. package/dist/core/body/HardLockToTargetBody.js +20 -0
  54. package/dist/core/body/OrbitFollowBody.d.ts +47 -0
  55. package/dist/core/body/OrbitFollowBody.js +48 -0
  56. package/dist/core/body/PositionComposerBody.d.ts +28 -0
  57. package/dist/core/body/PositionComposerBody.js +27 -0
  58. package/dist/core/body/follow.d.ts +33 -0
  59. package/dist/core/body/follow.js +83 -0
  60. package/dist/core/body/hardLockToTarget.d.ts +17 -0
  61. package/dist/core/body/hardLockToTarget.js +26 -0
  62. package/dist/core/body/index.d.ts +17 -0
  63. package/dist/core/body/orbitFollow.d.ts +76 -0
  64. package/dist/core/body/orbitFollow.js +336 -0
  65. package/dist/core/body/positionComposer.d.ts +56 -0
  66. package/dist/core/body/positionComposer.js +207 -0
  67. package/dist/core/body/safeFromToRotation.d.ts +3 -0
  68. package/dist/core/body/safeFromToRotation.js +39 -0
  69. package/dist/core/body/threeRing.d.ts +28 -0
  70. package/dist/core/body/threeRing.js +100 -0
  71. package/dist/core/body/tracker.d.ts +42 -0
  72. package/dist/core/body/tracker.js +193 -0
  73. package/dist/core/damping/Damper.d.ts +11 -0
  74. package/dist/core/damping/Damper.js +22 -0
  75. package/dist/core/damping/damping.d.ts +30 -0
  76. package/dist/core/damping/damping.js +119 -0
  77. package/dist/core/damping/index.d.ts +5 -0
  78. package/dist/core/damping/predictor.d.ts +16 -0
  79. package/dist/core/damping/predictor.js +56 -0
  80. package/dist/core/debug/debugZones.d.ts +16 -0
  81. package/dist/core/debug/debugZones.js +38 -0
  82. package/dist/core/debug/index.d.ts +2 -0
  83. package/dist/core/extension/GroupFramingExtension.d.ts +26 -0
  84. package/dist/core/extension/GroupFramingExtension.js +24 -0
  85. package/dist/core/extension/LensExtension.d.ts +20 -0
  86. package/dist/core/extension/LensExtension.js +12 -0
  87. package/dist/core/extension/groupFraming.d.ts +62 -0
  88. package/dist/core/extension/groupFraming.js +271 -0
  89. package/dist/core/extension/index.d.ts +6 -0
  90. package/dist/core/extension/lens.d.ts +35 -0
  91. package/dist/core/extension/lens.js +57 -0
  92. package/dist/core/groups/ClearShot.d.ts +32 -0
  93. package/dist/core/groups/MixingCamera.d.ts +20 -0
  94. package/dist/core/groups/Sequencer.d.ts +24 -0
  95. package/dist/core/groups/StateDrivenCamera.d.ts +26 -0
  96. package/dist/core/groups/clearShotState.d.ts +32 -0
  97. package/dist/core/groups/index.d.ts +11 -0
  98. package/dist/core/groups/mixCameraStates.d.ts +13 -0
  99. package/dist/core/groups/sequencerState.d.ts +26 -0
  100. package/dist/core/groups/stateDrivenState.d.ts +28 -0
  101. package/dist/core/impulse/ImpulseField.d.ts +15 -0
  102. package/dist/core/impulse/ImpulseField.js +22 -0
  103. package/dist/core/impulse/ImpulseListenerNoise.d.ts +19 -0
  104. package/dist/core/impulse/ImpulseListenerNoise.js +29 -0
  105. package/dist/core/impulse/impulseListener.d.ts +13 -0
  106. package/dist/core/impulse/impulseListener.js +14 -0
  107. package/dist/core/impulse/impulses.d.ts +54 -0
  108. package/dist/core/impulse/impulses.js +84 -0
  109. package/dist/core/impulse/index.d.ts +6 -0
  110. package/dist/core/index.d.ts +20 -0
  111. package/dist/core/index.js +52 -0
  112. package/dist/core/input/InputAxis.d.ts +29 -0
  113. package/dist/core/input/InputAxis.js +28 -0
  114. package/dist/core/input/InputAxisOwner.d.ts +6 -0
  115. package/dist/core/input/InputAxisOwner.js +4 -0
  116. package/dist/core/input/InputController.d.ts +15 -0
  117. package/dist/core/input/InputController.js +24 -0
  118. package/dist/core/input/axis.d.ts +52 -0
  119. package/dist/core/input/axis.js +89 -0
  120. package/dist/core/input/consumedInput.d.ts +37 -0
  121. package/dist/core/input/consumedInput.js +34 -0
  122. package/dist/core/input/index.d.ts +9 -0
  123. package/dist/core/input/inputMapping.d.ts +46 -0
  124. package/dist/core/input/inputMapping.js +55 -0
  125. package/dist/core/input/shortestWrappedDelta.d.ts +2 -0
  126. package/dist/core/input/shortestWrappedDelta.js +11 -0
  127. package/dist/core/internal.d.ts +16 -0
  128. package/dist/core/internal.js +19 -0
  129. package/dist/core/klippState.d.ts +78 -0
  130. package/dist/core/klippState.js +124 -0
  131. package/dist/core/noise/BasicMultiChannelPerlinNoise.d.ts +21 -0
  132. package/dist/core/noise/BasicMultiChannelPerlinNoise.js +13 -0
  133. package/dist/core/noise/index.d.ts +3 -0
  134. package/dist/core/noise/perlinNoise.d.ts +36 -0
  135. package/dist/core/noise/perlinNoise.js +110 -0
  136. package/dist/core/params.d.ts +2 -0
  137. package/dist/core/params.js +12 -0
  138. package/dist/dom/DebugOverlay.d.ts +11 -0
  139. package/dist/dom/DebugOverlay.js +96 -0
  140. package/dist/dom/InputControllerDom.d.ts +15 -0
  141. package/dist/dom/InputControllerDom.js +31 -0
  142. package/dist/dom/InputSystem.d.ts +40 -0
  143. package/dist/dom/InputSystem.js +113 -0
  144. package/dist/dom/index.d.ts +3 -0
  145. package/dist/dom/index.js +5 -0
  146. package/dist/input-sources/buttonInput.d.ts +15 -0
  147. package/dist/input-sources/buttonInput.js +23 -0
  148. package/dist/input-sources/isInsideInteractiveArea.d.ts +9 -0
  149. package/dist/input-sources/isInsideInteractiveArea.js +11 -0
  150. package/dist/input-sources/mouse.d.ts +47 -0
  151. package/dist/input-sources/mouse.js +171 -0
  152. package/dist/input-sources/safariGesture.d.ts +32 -0
  153. package/dist/input-sources/safariGesture.js +107 -0
  154. package/dist/input-sources/suppressNativeGestures.d.ts +5 -0
  155. package/dist/input-sources/suppressNativeGestures.js +32 -0
  156. package/dist/input-sources/touch.d.ts +47 -0
  157. package/dist/input-sources/touch.js +173 -0
  158. package/dist/input-sources/wheel.d.ts +28 -0
  159. package/dist/input-sources/wheel.js +44 -0
  160. package/dist/react/CameraFrustumHelper.d.ts +13 -0
  161. package/dist/react/CameraFrustumHelper.js +32 -0
  162. package/dist/react/DebugZoneOverlay.d.ts +7 -0
  163. package/dist/react/DebugZoneOverlay.js +23 -0
  164. package/dist/react/Klipp.d.ts +20 -0
  165. package/dist/react/Klipp.js +47 -0
  166. package/dist/react/KlippContext.d.ts +5 -0
  167. package/dist/react/KlippContext.js +11 -0
  168. package/dist/react/VirtualCamera.d.ts +28 -0
  169. package/dist/react/VirtualCamera.js +81 -0
  170. package/dist/react/VirtualCameraContext.d.ts +11 -0
  171. package/dist/react/VirtualCameraContext.js +21 -0
  172. package/dist/react/aim/Aim.d.ts +11 -0
  173. package/dist/react/aim/Aim.js +14 -0
  174. package/dist/react/aim/HardLookAt.d.ts +10 -0
  175. package/dist/react/aim/HardLookAt.js +15 -0
  176. package/dist/react/aim/PanTilt.d.ts +31 -0
  177. package/dist/react/aim/PanTilt.js +38 -0
  178. package/dist/react/aim/RotateWithFollowTarget.d.ts +10 -0
  179. package/dist/react/aim/RotateWithFollowTarget.js +18 -0
  180. package/dist/react/aim/RotationComposer.d.ts +12 -0
  181. package/dist/react/aim/RotationComposer.js +34 -0
  182. package/dist/react/body/Body.d.ts +11 -0
  183. package/dist/react/body/Body.js +14 -0
  184. package/dist/react/body/CameraControls.d.ts +50 -0
  185. package/dist/react/body/CameraControls.js +106 -0
  186. package/dist/react/body/Follow.d.ts +10 -0
  187. package/dist/react/body/Follow.js +20 -0
  188. package/dist/react/body/HardLockToTarget.d.ts +10 -0
  189. package/dist/react/body/HardLockToTarget.js +18 -0
  190. package/dist/react/body/OrbitFollow.d.ts +25 -0
  191. package/dist/react/body/OrbitFollow.js +67 -0
  192. package/dist/react/body/PositionComposer.d.ts +12 -0
  193. package/dist/react/body/PositionComposer.js +32 -0
  194. package/dist/react/body/camera-controls.d.ts +2 -0
  195. package/dist/react/body/camera-controls.js +3 -0
  196. package/dist/react/extension/Extension.d.ts +7 -0
  197. package/dist/react/extension/Extension.js +10 -0
  198. package/dist/react/extension/GroupFraming.d.ts +14 -0
  199. package/dist/react/extension/GroupFraming.js +52 -0
  200. package/dist/react/extension/Lens.d.ts +7 -0
  201. package/dist/react/extension/Lens.js +31 -0
  202. package/dist/react/impulse/ImpulseListener.d.ts +12 -0
  203. package/dist/react/impulse/ImpulseListener.js +33 -0
  204. package/dist/react/index.d.ts +24 -0
  205. package/dist/react/index.js +24 -0
  206. package/dist/react/input/InputAxisOwnerContext.d.ts +3 -0
  207. package/dist/react/input/InputAxisOwnerContext.js +6 -0
  208. package/dist/react/input/InputController.d.ts +53 -0
  209. package/dist/react/input/InputController.js +115 -0
  210. package/dist/react/noise/BasicMultiChannelPerlin.d.ts +7 -0
  211. package/dist/react/noise/BasicMultiChannelPerlin.js +14 -0
  212. package/dist/react/noise/Noise.d.ts +5 -0
  213. package/dist/react/noise/Noise.js +6 -0
  214. package/dist/react/noise/useBasicMultiChannelPerlinNoise.d.ts +4 -0
  215. package/dist/react/noise/useBasicMultiChannelPerlinNoise.js +21 -0
  216. package/dist/react/useCameraTransitionEvent.d.ts +12 -0
  217. package/dist/react/useCameraTransitionEvent.js +14 -0
  218. package/dist/three/CameraFrustumHelperThree.d.ts +11 -0
  219. package/dist/three/CameraFrustumHelperThree.js +44 -0
  220. package/dist/three/KlippThree.d.ts +18 -0
  221. package/dist/three/KlippThree.js +50 -0
  222. package/dist/three/VirtualCameraThree.d.ts +35 -0
  223. package/dist/three/VirtualCameraThree.js +108 -0
  224. package/dist/three/aim/HardLookAtAimThree.d.ts +10 -0
  225. package/dist/three/aim/HardLookAtAimThree.js +14 -0
  226. package/dist/three/aim/PanTiltAimThree.d.ts +10 -0
  227. package/dist/three/aim/PanTiltAimThree.js +15 -0
  228. package/dist/three/aim/RotateWithFollowTargetAimThree.d.ts +11 -0
  229. package/dist/three/aim/RotateWithFollowTargetAimThree.js +15 -0
  230. package/dist/three/aim/RotationComposerAimThree.d.ts +26 -0
  231. package/dist/three/aim/RotationComposerAimThree.js +35 -0
  232. package/dist/three/body/CameraControlsBodyThree.d.ts +30 -0
  233. package/dist/three/body/CameraControlsBodyThree.js +54 -0
  234. package/dist/three/body/FollowBodyThree.d.ts +16 -0
  235. package/dist/three/body/FollowBodyThree.js +23 -0
  236. package/dist/three/body/HardLockToTargetBodyThree.d.ts +11 -0
  237. package/dist/three/body/HardLockToTargetBodyThree.js +14 -0
  238. package/dist/three/body/OrbitFollowBodyThree.d.ts +16 -0
  239. package/dist/three/body/OrbitFollowBodyThree.js +23 -0
  240. package/dist/three/body/OrbitFollowHelperThree.d.ts +23 -0
  241. package/dist/three/body/OrbitFollowHelperThree.js +85 -0
  242. package/dist/three/body/PositionComposerBodyThree.d.ts +24 -0
  243. package/dist/three/body/PositionComposerBodyThree.js +31 -0
  244. package/dist/three/camera.d.ts +10 -0
  245. package/dist/three/camera.js +39 -0
  246. package/dist/three/damping/Predictor.d.ts +12 -0
  247. package/dist/three/damping/Predictor.js +30 -0
  248. package/dist/three/damping/QuaternionDamper.d.ts +10 -0
  249. package/dist/three/damping/QuaternionDamper.js +28 -0
  250. package/dist/three/damping/Vector3Damper.d.ts +10 -0
  251. package/dist/three/damping/Vector3Damper.js +26 -0
  252. package/dist/three/extension/GroupFramingExtensionThree.d.ts +13 -0
  253. package/dist/three/extension/GroupFramingExtensionThree.js +23 -0
  254. package/dist/three/extension/TargetGroup.d.ts +32 -0
  255. package/dist/three/extension/TargetGroup.js +53 -0
  256. package/dist/three/index.d.ts +24 -0
  257. package/dist/three/index.js +25 -0
  258. package/dist/three/noise/BasicMultiChannelPerlinNoiseThree.d.ts +16 -0
  259. package/dist/three/noise/BasicMultiChannelPerlinNoiseThree.js +17 -0
  260. package/dist/three/readTargetExtent.d.ts +9 -0
  261. package/dist/three/readTargetExtent.js +25 -0
  262. package/dist/three/readTargetPose.d.ts +8 -0
  263. package/dist/three/readTargetPose.js +21 -0
  264. package/dist/three/resolve/Target.d.ts +17 -0
  265. package/dist/three/resolve/Target.js +62 -0
  266. package/dist/three/resolve/TargetRegistry.d.ts +27 -0
  267. package/dist/three/resolve/TargetRegistry.js +78 -0
  268. package/dist/three/resolve/resolveVector3.d.ts +12 -0
  269. package/dist/three/resolve/resolveVector3.js +29 -0
  270. package/package.json +120 -4
@@ -0,0 +1,108 @@
1
+ import { attachTo, prepare } from "../core/internal.js";
2
+ import { VirtualCamera } from "../core/VirtualCamera.js";
3
+ import { isVector3Like, resolveVector3 } from "./resolve/resolveVector3.js";
4
+ import { TargetGroup } from "./extension/TargetGroup.js";
5
+ import { vec4 } from "math";
6
+ import { Quaternion, Vector3 } from "three";
7
+ //#region src/three/VirtualCameraThree.ts
8
+ var isRegistrable = (target) => target != null && !isVector3Like(target);
9
+ var reads = (piece) => "targetSlot" in piece;
10
+ var scratch = new Vector3();
11
+ /** `VirtualCamera` for three.js: points every piece's target at its slot in the `KlippThree`'s registry. */
12
+ var VirtualCameraThree = class extends VirtualCamera {
13
+ /** The target registry of the `KlippThree` this camera is in. */
14
+ registry = null;
15
+ slots = /* @__PURE__ */ new Map();
16
+ groupSlots = /* @__PURE__ */ new Map();
17
+ constructor(name, options = {}) {
18
+ super(name, {
19
+ ...options,
20
+ initialState: options.initialState && resolveInitialState(options.initialState)
21
+ });
22
+ }
23
+ [attachTo](klipp) {
24
+ this.releaseSlots();
25
+ super[attachTo](klipp);
26
+ this.registry = klipp && "targets" in klipp ? klipp.targets : null;
27
+ }
28
+ [prepare](width, height) {
29
+ super[prepare](width, height);
30
+ for (const piece of this.pieces) {
31
+ if (reads(piece)) this.syncSlot(piece);
32
+ if ("group" in piece && piece.group instanceof TargetGroup) this.syncGroupSlots(piece.group);
33
+ }
34
+ }
35
+ removePiece(piece) {
36
+ super.removePiece(piece);
37
+ if (reads(piece)) {
38
+ const target = this.slots.get(piece);
39
+ if (target !== void 0) {
40
+ if (isRegistrable(target)) this.registry?.release(target);
41
+ this.slots.delete(piece);
42
+ }
43
+ piece.targetSlot = null;
44
+ }
45
+ if ("group" in piece && piece.group instanceof TargetGroup) this.releaseGroupSlots(piece.group);
46
+ }
47
+ releaseSlots() {
48
+ for (const [piece, target] of this.slots) {
49
+ if (isRegistrable(target)) this.registry?.release(target);
50
+ piece.targetSlot = null;
51
+ }
52
+ this.slots.clear();
53
+ for (const group of [...this.groupSlots.keys()]) this.releaseGroupSlots(group);
54
+ }
55
+ syncSlot(piece) {
56
+ if (!this.registry) return;
57
+ const { target } = piece;
58
+ if (this.slots.has(piece) && this.slots.get(piece) === target) return;
59
+ const previous = this.slots.get(piece);
60
+ if (previous !== void 0 && isRegistrable(previous)) this.registry.release(previous);
61
+ this.slots.set(piece, target);
62
+ piece.targetSlot = isRegistrable(target) ? this.registry.acquire(target) : null;
63
+ }
64
+ syncGroupSlots(group) {
65
+ if (!this.registry) return;
66
+ const previous = this.groupSlots.get(group);
67
+ const { members } = group;
68
+ let count = 0;
69
+ let changed = previous === void 0;
70
+ for (const member of members) {
71
+ if (!isRegistrable(member.target)) continue;
72
+ if (!changed && previous[count] !== member.target) changed = true;
73
+ count++;
74
+ }
75
+ if (!changed && previous.length === count) return;
76
+ this.releaseGroupSlots(group);
77
+ const targets = [];
78
+ const slots = /* @__PURE__ */ new Map();
79
+ for (const member of members) {
80
+ if (!isRegistrable(member.target)) continue;
81
+ targets.push(member.target);
82
+ slots.set(member.target, this.registry.acquire(member.target));
83
+ }
84
+ this.groupSlots.set(group, targets);
85
+ group.memberSlots = slots;
86
+ }
87
+ releaseGroupSlots(group) {
88
+ const previous = this.groupSlots.get(group);
89
+ if (!previous) return;
90
+ for (const target of previous) this.registry?.release(target);
91
+ this.groupSlots.delete(group);
92
+ group.memberSlots = /* @__PURE__ */ new Map();
93
+ }
94
+ };
95
+ /** `initialState` with every vector shorthand resolved to tuples. */
96
+ function resolveInitialState(initialState) {
97
+ const { position, quaternion, target, lookAtTarget, referenceUp, ...rest } = initialState;
98
+ const resolved = { ...rest };
99
+ if (position) resolved.position = resolveVector3(scratch, position).toArray();
100
+ if (quaternion instanceof Quaternion) resolved.quaternion = quaternion.toArray();
101
+ else if (quaternion) resolved.quaternion = vec4.clone(quaternion);
102
+ if (target) resolved.target = resolveVector3(scratch, target).toArray();
103
+ if (lookAtTarget) resolved.lookAtTarget = resolveVector3(scratch, lookAtTarget).toArray();
104
+ if (referenceUp) resolved.referenceUp = resolveVector3(scratch, referenceUp).toArray();
105
+ return resolved;
106
+ }
107
+ //#endregion
108
+ export { VirtualCameraThree };
@@ -0,0 +1,10 @@
1
+ import { HardLookAtAim } from '../../core/aim/HardLookAtAim.js';
2
+ import type { TargetPose } from '../../core/TargetPose.js';
3
+ import type { Target } from '../resolve/Target.js';
4
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
5
+ /** Rotates so an `Object3D`, ref or fixed point is dead-center. */
6
+ export declare class HardLookAtAimThree extends HardLookAtAim<Target> {
7
+ targetSlot: TargetSlot | null;
8
+ private readonly pose;
9
+ protected readTarget(): TargetPose | null;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { HardLookAtAim } from "../../core/aim/HardLookAtAim.js";
3
+ import { readTargetPose } from "../readTargetPose.js";
4
+ //#region src/three/aim/HardLookAtAimThree.ts
5
+ /** Rotates so an `Object3D`, ref or fixed point is dead-center. */
6
+ var HardLookAtAimThree = class extends HardLookAtAim {
7
+ targetSlot = null;
8
+ pose = create();
9
+ readTarget() {
10
+ return readTargetPose(this.pose, this.target, this.targetSlot, false) ? this.pose : null;
11
+ }
12
+ };
13
+ //#endregion
14
+ export { HardLookAtAimThree };
@@ -0,0 +1,10 @@
1
+ import { PanTiltAim } from '../../core/aim/PanTiltAim.js';
2
+ import type { TargetPose } from '../../core/TargetPose.js';
3
+ import type { Target } from '../resolve/Target.js';
4
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
5
+ /** `PanTiltAim` relative to an optional `Object3D` or ref's rotation. */
6
+ export declare class PanTiltAimThree extends PanTiltAim<Target> {
7
+ targetSlot: TargetSlot | null;
8
+ private readonly pose;
9
+ protected readTarget(): TargetPose;
10
+ }
@@ -0,0 +1,15 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { PanTiltAim } from "../../core/aim/PanTiltAim.js";
3
+ import { readTargetRotation } from "../readTargetPose.js";
4
+ //#region src/three/aim/PanTiltAimThree.ts
5
+ /** `PanTiltAim` relative to an optional `Object3D` or ref's rotation. */
6
+ var PanTiltAimThree = class extends PanTiltAim {
7
+ targetSlot = null;
8
+ pose = create();
9
+ readTarget() {
10
+ this.pose.hasRotation = readTargetRotation(this.pose.rotation, this.target, this.targetSlot);
11
+ return this.pose;
12
+ }
13
+ };
14
+ //#endregion
15
+ export { PanTiltAimThree };
@@ -0,0 +1,11 @@
1
+ import { RotateWithFollowTargetAim, type RotateWithFollowTargetOptions } from '../../core/aim/RotateWithFollowTargetAim.js';
2
+ import type { TargetPose } from '../../core/TargetPose.js';
3
+ import type { Target } from '../resolve/Target.js';
4
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
5
+ export type { RotateWithFollowTargetOptions };
6
+ /** Follows the rotation of an `Object3D` or ref. */
7
+ export declare class RotateWithFollowTargetAimThree extends RotateWithFollowTargetAim<Target> {
8
+ targetSlot: TargetSlot | null;
9
+ private readonly pose;
10
+ protected readTarget(): TargetPose;
11
+ }
@@ -0,0 +1,15 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { RotateWithFollowTargetAim } from "../../core/aim/RotateWithFollowTargetAim.js";
3
+ import { readTargetRotation } from "../readTargetPose.js";
4
+ //#region src/three/aim/RotateWithFollowTargetAimThree.ts
5
+ /** Follows the rotation of an `Object3D` or ref. */
6
+ var RotateWithFollowTargetAimThree = class extends RotateWithFollowTargetAim {
7
+ targetSlot = null;
8
+ pose = create();
9
+ readTarget() {
10
+ this.pose.hasRotation = readTargetRotation(this.pose.rotation, this.target, this.targetSlot);
11
+ return this.pose;
12
+ }
13
+ };
14
+ //#endregion
15
+ export { RotateWithFollowTargetAimThree };
@@ -0,0 +1,26 @@
1
+ import type { RotationComposerParams } from '../../core/aim/rotationComposer.js';
2
+ import { RotationComposerAim } from '../../core/aim/RotationComposerAim.js';
3
+ import type { TargetPose } from '../../core/TargetPose.js';
4
+ import { type Vector3Like } from '../resolve/resolveVector3.js';
5
+ import type { Target } from '../resolve/Target.js';
6
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
7
+ export type RotationComposerThreeOptions = Partial<Omit<RotationComposerParams, 'targetOffset'>> & {
8
+ /** Offset from the target, in its local space. */
9
+ targetOffset?: Vector3Like;
10
+ /** Target radius used when composing its visible edge. Ignored when `size` is set. */
11
+ radius?: number;
12
+ /** Target dimensions used when composing its visible edges. Measured automatically for meshes. */
13
+ size?: Vector3Like;
14
+ };
15
+ /** Rotates the camera to place an `Object3D`, ref or fixed point at `screenPosition`. */
16
+ export declare class RotationComposerAimThree extends RotationComposerAim<Target> {
17
+ targetSlot: TargetSlot | null;
18
+ radius?: number;
19
+ size?: Vector3Like;
20
+ private readonly pose;
21
+ private forceSizeRecalculation;
22
+ constructor(target: Target, { targetOffset, radius, size, ...options }?: RotationComposerThreeOptions);
23
+ /** Forces the auto-detected `size` to be re-measured on the next `update()`, then goes back to the cached value. */
24
+ recalculateSize(): void;
25
+ protected readTarget(): TargetPose | null;
26
+ }
@@ -0,0 +1,35 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { needsExtent } from "../../core/aim/rotationComposer.js";
3
+ import { RotationComposerAim } from "../../core/aim/RotationComposerAim.js";
4
+ import { optionalVec3 } from "../resolve/resolveVector3.js";
5
+ import { readTargetExtent } from "../readTargetExtent.js";
6
+ import { readTargetPose } from "../readTargetPose.js";
7
+ //#region src/three/aim/RotationComposerAimThree.ts
8
+ /** Rotates the camera to place an `Object3D`, ref or fixed point at `screenPosition`. */
9
+ var RotationComposerAimThree = class extends RotationComposerAim {
10
+ targetSlot = null;
11
+ radius;
12
+ size;
13
+ pose = create();
14
+ forceSizeRecalculation = false;
15
+ constructor(target, { targetOffset, radius, size, ...options } = {}) {
16
+ super(target, {
17
+ ...options,
18
+ targetOffset: optionalVec3(targetOffset)
19
+ });
20
+ this.radius = radius;
21
+ this.size = size;
22
+ }
23
+ /** Forces the auto-detected `size` to be re-measured on the next `update()`, then goes back to the cached value. */
24
+ recalculateSize() {
25
+ this.forceSizeRecalculation = true;
26
+ }
27
+ readTarget() {
28
+ if (!readTargetPose(this.pose, this.target, this.targetSlot, true)) return null;
29
+ if (needsExtent(this)) readTargetExtent(this.pose.extent, this.target, this.size, this.radius, this.forceSizeRecalculation, this.targetSlot);
30
+ this.forceSizeRecalculation = false;
31
+ return this.pose;
32
+ }
33
+ };
34
+ //#endregion
35
+ export { RotationComposerAimThree };
@@ -0,0 +1,30 @@
1
+ import * as THREE from 'three';
2
+ import CameraControls from 'camera-controls';
3
+ import type { CameraState } from '../../core/CameraState.js';
4
+ import { type Vector3Like } from '../resolve/resolveVector3.js';
5
+ import { type Target } from '../resolve/Target.js';
6
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
7
+ export type CameraControlsOptions = {
8
+ /** Viewport width divided by height. */
9
+ aspect?: number;
10
+ /** Where the camera starts. */
11
+ initialPosition?: Vector3Like | null;
12
+ /** A `CameraControls` subclass to use instead. */
13
+ impl?: typeof CameraControls;
14
+ /** Animate the internal `camera-controls` calls. */
15
+ enableTransition?: boolean;
16
+ };
17
+ /** Adapts `camera-controls` orbit and dolly input to the virtual camera pipeline. */
18
+ export declare class CameraControlsBodyThree {
19
+ target: Target;
20
+ targetSlot: TargetSlot | null;
21
+ aspect: number;
22
+ enableTransition: boolean;
23
+ readonly controls: CameraControls;
24
+ readonly initialPosition: THREE.Vector3 | null;
25
+ private readonly camera;
26
+ private hasResolvedTargetOnce;
27
+ private wasResolvedLastFrame;
28
+ constructor(target: Target, options?: CameraControlsOptions);
29
+ update: (out: CameraState, dt: number, justActivated: boolean) => void;
30
+ }
@@ -0,0 +1,54 @@
1
+ import { resolveVector3 } from "../resolve/resolveVector3.js";
2
+ import { resolveTargetPosition } from "../resolve/Target.js";
3
+ import * as THREE from "three";
4
+ import CameraControls from "camera-controls";
5
+ //#region src/three/body/CameraControlsBodyThree.ts
6
+ CameraControls.install({ THREE });
7
+ var scratchTargetPosition = new THREE.Vector3();
8
+ /** Adapts `camera-controls` orbit and dolly input to the virtual camera pipeline. */
9
+ var CameraControlsBodyThree = class {
10
+ target;
11
+ targetSlot = null;
12
+ aspect;
13
+ enableTransition;
14
+ controls;
15
+ initialPosition;
16
+ camera;
17
+ hasResolvedTargetOnce = false;
18
+ wasResolvedLastFrame = false;
19
+ constructor(target, options) {
20
+ this.target = target;
21
+ this.aspect = options?.aspect ?? 1;
22
+ this.enableTransition = options?.enableTransition ?? false;
23
+ this.camera = new THREE.PerspectiveCamera();
24
+ this.controls = new ((options?.impl) ?? CameraControls)(this.camera);
25
+ this.initialPosition = options?.initialPosition != null ? resolveVector3(new THREE.Vector3(), options.initialPosition) : null;
26
+ if (this.initialPosition) {
27
+ const { x, y, z } = this.initialPosition;
28
+ this.controls.setPosition(x, y, z, false);
29
+ }
30
+ }
31
+ update = (out, dt, justActivated) => {
32
+ this.camera.fov = out.fov;
33
+ this.camera.near = out.near;
34
+ this.camera.far = out.far;
35
+ this.camera.aspect = this.aspect;
36
+ this.camera.updateProjectionMatrix();
37
+ const resolved = resolveTargetPosition(scratchTargetPosition, this.target, this.targetSlot);
38
+ if (resolved && (!this.wasResolvedLastFrame || justActivated)) this.controls.normalizeRotations().setTarget(scratchTargetPosition.x, scratchTargetPosition.y, scratchTargetPosition.z, this.enableTransition);
39
+ else if (resolved) this.controls.moveTo(scratchTargetPosition.x, scratchTargetPosition.y, scratchTargetPosition.z, this.enableTransition);
40
+ if (resolved) this.hasResolvedTargetOnce = true;
41
+ this.wasResolvedLastFrame = resolved;
42
+ this.controls.update(dt);
43
+ if (this.target == null || resolved || this.hasResolvedTargetOnce || this.initialPosition !== null) {
44
+ this.camera.position.toArray(out.position);
45
+ this.camera.quaternion.toArray(out.quaternion);
46
+ }
47
+ out.hasTarget = resolved;
48
+ if (resolved) scratchTargetPosition.toArray(out.target);
49
+ out.hasLookAtTarget = resolved;
50
+ if (resolved) scratchTargetPosition.toArray(out.lookAtTarget);
51
+ };
52
+ };
53
+ //#endregion
54
+ export { CameraControlsBodyThree };
@@ -0,0 +1,16 @@
1
+ import { FollowBody, type FollowOptions as FollowCoreOptions } from '../../core/body/FollowBody.js';
2
+ import type { TargetPose } from '../../core/TargetPose.js';
3
+ import { type Vector3Like } from '../resolve/resolveVector3.js';
4
+ import type { Target } from '../resolve/Target.js';
5
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
6
+ export type FollowThreeOptions = Omit<FollowCoreOptions, 'offset'> & {
7
+ /** Offset from the target, rotated according to `bindingMode`. */
8
+ offset?: Vector3Like;
9
+ };
10
+ /** Follows an `Object3D`, ref or fixed point with an offset rotated according to `bindingMode`. */
11
+ export declare class FollowBodyThree extends FollowBody<Target> {
12
+ targetSlot: TargetSlot | null;
13
+ private readonly pose;
14
+ constructor(target: Target, { offset, ...options }?: FollowThreeOptions);
15
+ protected readTarget(): TargetPose | null;
16
+ }
@@ -0,0 +1,23 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { needsTargetRotation } from "../../core/body/follow.js";
3
+ import { FollowBody } from "../../core/body/FollowBody.js";
4
+ import { optionalVec3 } from "../resolve/resolveVector3.js";
5
+ import { readTargetPose } from "../readTargetPose.js";
6
+ //#region src/three/body/FollowBodyThree.ts
7
+ /** Follows an `Object3D`, ref or fixed point with an offset rotated according to `bindingMode`. */
8
+ var FollowBodyThree = class extends FollowBody {
9
+ targetSlot = null;
10
+ pose = create();
11
+ constructor(target, { offset, ...options } = {}) {
12
+ super(target, {
13
+ ...options,
14
+ offset: optionalVec3(offset)
15
+ });
16
+ }
17
+ readTarget() {
18
+ const withRotation = needsTargetRotation(this.state, this);
19
+ return readTargetPose(this.pose, this.target, this.targetSlot, withRotation) ? this.pose : null;
20
+ }
21
+ };
22
+ //#endregion
23
+ export { FollowBodyThree };
@@ -0,0 +1,11 @@
1
+ import { HardLockToTargetBody, type HardLockToTargetOptions } from '../../core/body/HardLockToTargetBody.js';
2
+ import type { TargetPose } from '../../core/TargetPose.js';
3
+ import type { Target } from '../resolve/Target.js';
4
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
5
+ export type { HardLockToTargetOptions };
6
+ /** Locks the camera position to an `Object3D`, ref or fixed point, optionally with damping. */
7
+ export declare class HardLockToTargetBodyThree extends HardLockToTargetBody<Target> {
8
+ targetSlot: TargetSlot | null;
9
+ private readonly pose;
10
+ protected readTarget(): TargetPose | null;
11
+ }
@@ -0,0 +1,14 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { HardLockToTargetBody } from "../../core/body/HardLockToTargetBody.js";
3
+ import { readTargetPose } from "../readTargetPose.js";
4
+ //#region src/three/body/HardLockToTargetBodyThree.ts
5
+ /** Locks the camera position to an `Object3D`, ref or fixed point, optionally with damping. */
6
+ var HardLockToTargetBodyThree = class extends HardLockToTargetBody {
7
+ targetSlot = null;
8
+ pose = create();
9
+ readTarget() {
10
+ return readTargetPose(this.pose, this.target, this.targetSlot, false) ? this.pose : null;
11
+ }
12
+ };
13
+ //#endregion
14
+ export { HardLockToTargetBodyThree };
@@ -0,0 +1,16 @@
1
+ import { OrbitFollowBody, type OrbitFollowOptions } from '../../core/body/OrbitFollowBody.js';
2
+ import type { TargetPose } from '../../core/TargetPose.js';
3
+ import { type Vector3Like } from '../resolve/resolveVector3.js';
4
+ import type { Target } from '../resolve/Target.js';
5
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
6
+ export type OrbitFollowThreeOptions = Omit<OrbitFollowOptions, 'targetOffset'> & {
7
+ /** Center of the orbit relative to the target, rotated according to `bindingMode`. */
8
+ targetOffset?: Vector3Like;
9
+ };
10
+ /** Orbits an `Object3D`, ref or fixed point, driven by `horizontal`, `vertical` and `radial`. */
11
+ export declare class OrbitFollowBodyThree extends OrbitFollowBody<Target> {
12
+ targetSlot: TargetSlot | null;
13
+ private readonly pose;
14
+ constructor(target: Target, { targetOffset, ...options }?: OrbitFollowThreeOptions);
15
+ protected readTarget(): TargetPose | null;
16
+ }
@@ -0,0 +1,23 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { needsTargetRotation } from "../../core/body/orbitFollow.js";
3
+ import { OrbitFollowBody } from "../../core/body/OrbitFollowBody.js";
4
+ import { optionalVec3 } from "../resolve/resolveVector3.js";
5
+ import { readTargetPose } from "../readTargetPose.js";
6
+ //#region src/three/body/OrbitFollowBodyThree.ts
7
+ /** Orbits an `Object3D`, ref or fixed point, driven by `horizontal`, `vertical` and `radial`. */
8
+ var OrbitFollowBodyThree = class extends OrbitFollowBody {
9
+ targetSlot = null;
10
+ pose = create();
11
+ constructor(target, { targetOffset, ...options } = {}) {
12
+ super(target, {
13
+ ...options,
14
+ targetOffset: optionalVec3(targetOffset)
15
+ });
16
+ }
17
+ readTarget() {
18
+ const withRotation = needsTargetRotation(this.state, this);
19
+ return readTargetPose(this.pose, this.target, this.targetSlot, withRotation) ? this.pose : null;
20
+ }
21
+ };
22
+ //#endregion
23
+ export { OrbitFollowBodyThree };
@@ -0,0 +1,23 @@
1
+ import { BufferGeometry, Color, LineBasicMaterial, LineSegments } from 'three';
2
+ import type { OrbitFollowBody } from '../../core/body/OrbitFollowBody.js';
3
+ /**
4
+ * Draws an `OrbitFollowBody`'s orbit around its tracked point: the circle the camera moves along with `horizontal`,
5
+ * the arc it moves along with `vertical`, and for `threeRing` also the three rings.
6
+ */
7
+ export declare class OrbitFollowHelperThree extends LineSegments<BufferGeometry, LineBasicMaterial> {
8
+ readonly colors: {
9
+ horizontal: Color;
10
+ vertical: Color;
11
+ rings: Color;
12
+ };
13
+ private readonly positions;
14
+ private readonly vertexColors;
15
+ private vertexCount;
16
+ constructor();
17
+ /** Redraws the orbit from `body`'s last update. */
18
+ sync(body: OrbitFollowBody<unknown>): void;
19
+ dispose(): void;
20
+ private circle;
21
+ /** Adds the segment from `previous` to `next`, then moves `previous` to `next`. */
22
+ private segment;
23
+ }
@@ -0,0 +1,85 @@
1
+ import { point } from "../../core/body/orbitFollow.js";
2
+ import { BufferAttribute, BufferGeometry, Color, LineBasicMaterial, LineSegments } from "three";
3
+ //#region src/three/body/OrbitFollowHelperThree.ts
4
+ var circleSegments = 64;
5
+ var arcSegments = 32;
6
+ var maxVertices = 576;
7
+ var defaultRange = [-90, 90];
8
+ var previous = [
9
+ 0,
10
+ 0,
11
+ 0
12
+ ];
13
+ var next = [
14
+ 0,
15
+ 0,
16
+ 0
17
+ ];
18
+ /**
19
+ * Draws an `OrbitFollowBody`'s orbit around its tracked point: the circle the camera moves along with `horizontal`,
20
+ * the arc it moves along with `vertical`, and for `threeRing` also the three rings.
21
+ */
22
+ var OrbitFollowHelperThree = class extends LineSegments {
23
+ colors = {
24
+ horizontal: new Color("#ff9f1c"),
25
+ vertical: new Color("#2ec4f1"),
26
+ rings: new Color("#9a9aa8")
27
+ };
28
+ positions = new Float32Array(maxVertices * 3);
29
+ vertexColors = new Float32Array(maxVertices * 3);
30
+ vertexCount = 0;
31
+ constructor() {
32
+ super(new BufferGeometry(), new LineBasicMaterial({
33
+ vertexColors: true,
34
+ toneMapped: false
35
+ }));
36
+ this.geometry.setAttribute("position", new BufferAttribute(this.positions, 3));
37
+ this.geometry.setAttribute("color", new BufferAttribute(this.vertexColors, 3));
38
+ this.frustumCulled = false;
39
+ }
40
+ /** Redraws the orbit from `body`'s last update. */
41
+ sync(body) {
42
+ const { horizontal, vertical } = body.state;
43
+ const [min, max] = vertical.range ?? defaultRange;
44
+ this.vertexCount = 0;
45
+ if (body.orbitStyle === "threeRing") {
46
+ this.circle(body, min, this.colors.rings);
47
+ this.circle(body, (min + max) / 2, this.colors.rings);
48
+ this.circle(body, max, this.colors.rings);
49
+ }
50
+ this.circle(body, vertical.value, this.colors.horizontal);
51
+ point(previous, body.state, body, horizontal.value, min);
52
+ for (let i = 1; i <= arcSegments; i++) {
53
+ point(next, body.state, body, horizontal.value, min + (max - min) * i / arcSegments);
54
+ this.segment(this.colors.vertical);
55
+ }
56
+ this.geometry.getAttribute("position").needsUpdate = true;
57
+ this.geometry.getAttribute("color").needsUpdate = true;
58
+ this.geometry.setDrawRange(0, this.vertexCount);
59
+ }
60
+ dispose() {
61
+ this.geometry.dispose();
62
+ this.material.dispose();
63
+ }
64
+ circle(body, vertical, color) {
65
+ point(previous, body.state, body, 0, vertical);
66
+ for (let i = 1; i <= circleSegments; i++) {
67
+ point(next, body.state, body, 360 * i / circleSegments, vertical);
68
+ this.segment(color);
69
+ }
70
+ }
71
+ /** Adds the segment from `previous` to `next`, then moves `previous` to `next`. */
72
+ segment(color) {
73
+ const offset = this.vertexCount * 3;
74
+ this.positions.set(previous, offset);
75
+ this.positions.set(next, offset + 3);
76
+ color.toArray(this.vertexColors, offset);
77
+ color.toArray(this.vertexColors, offset + 3);
78
+ this.vertexCount += 2;
79
+ previous[0] = next[0];
80
+ previous[1] = next[1];
81
+ previous[2] = next[2];
82
+ }
83
+ };
84
+ //#endregion
85
+ export { OrbitFollowHelperThree };
@@ -0,0 +1,24 @@
1
+ import type { PositionComposerParams } from '../../core/body/positionComposer.js';
2
+ import { PositionComposerBody } from '../../core/body/PositionComposerBody.js';
3
+ import type { TargetPose } from '../../core/TargetPose.js';
4
+ import type { Vector3Like } from '../resolve/resolveVector3.js';
5
+ import type { Target } from '../resolve/Target.js';
6
+ import type { TargetSlot } from '../resolve/TargetRegistry.js';
7
+ export type PositionComposerThreeOptions = Partial<PositionComposerParams> & {
8
+ /** Target radius used when composing its visible edge. Ignored when `size` is set. */
9
+ radius?: number;
10
+ /** Target dimensions used when composing its visible edges. Measured automatically for meshes. */
11
+ size?: Vector3Like;
12
+ };
13
+ /** Positions the camera around an `Object3D`, ref or fixed point, measuring its size from geometry. */
14
+ export declare class PositionComposerBodyThree extends PositionComposerBody<Target> {
15
+ targetSlot: TargetSlot | null;
16
+ radius?: number;
17
+ size?: Vector3Like;
18
+ private readonly pose;
19
+ private forceSizeRecalculation;
20
+ constructor(target: Target, options?: PositionComposerThreeOptions);
21
+ /** Forces the auto-detected `size` to be re-measured on the next `update()`, then goes back to the cached value. */
22
+ recalculateSize(): void;
23
+ protected readTarget(): TargetPose | null;
24
+ }
@@ -0,0 +1,31 @@
1
+ import { create } from "../../core/TargetPose.js";
2
+ import { needsExtent } from "../../core/body/positionComposer.js";
3
+ import { PositionComposerBody } from "../../core/body/PositionComposerBody.js";
4
+ import { readTargetExtent } from "../readTargetExtent.js";
5
+ import { readTargetPose } from "../readTargetPose.js";
6
+ //#region src/three/body/PositionComposerBodyThree.ts
7
+ /** Positions the camera around an `Object3D`, ref or fixed point, measuring its size from geometry. */
8
+ var PositionComposerBodyThree = class extends PositionComposerBody {
9
+ targetSlot = null;
10
+ radius;
11
+ size;
12
+ pose = create();
13
+ forceSizeRecalculation = false;
14
+ constructor(target, options) {
15
+ super(target, options);
16
+ this.radius = options?.radius;
17
+ this.size = options?.size;
18
+ }
19
+ /** Forces the auto-detected `size` to be re-measured on the next `update()`, then goes back to the cached value. */
20
+ recalculateSize() {
21
+ this.forceSizeRecalculation = true;
22
+ }
23
+ readTarget() {
24
+ if (!readTargetPose(this.pose, this.target, this.targetSlot, false)) return null;
25
+ if (needsExtent(this)) readTargetExtent(this.pose.extent, this.target, this.size, this.radius, this.forceSizeRecalculation, this.targetSlot);
26
+ this.forceSizeRecalculation = false;
27
+ return this.pose;
28
+ }
29
+ };
30
+ //#endregion
31
+ export { PositionComposerBodyThree };
@@ -0,0 +1,10 @@
1
+ import type { Object3D, PerspectiveCamera } from 'three';
2
+ import type { CameraState } from '../core/CameraState.js';
3
+ /** Read a perspective camera's transform and lens into `out`. */
4
+ export declare function copyCameraStateFromCamera(out: CameraState, camera: PerspectiveCamera): CameraState;
5
+ /** Write a camera state's position and rotation to a camera. */
6
+ export declare function writeCameraTransform(camera: Object3D, state: CameraState): void;
7
+ /** Write a camera state's lens and view offset to a perspective camera. */
8
+ export declare function writeCameraLens(camera: PerspectiveCamera, state: CameraState, viewportWidth: number, viewportHeight: number): void;
9
+ /** Apply a camera state to a perspective camera. */
10
+ export declare function applyCameraState(camera: PerspectiveCamera, state: CameraState, viewportWidth: number, viewportHeight: number): void;