diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 574bfef5a..0ba5f3067 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,6 +46,10 @@ jobs: if: runner.os != 'Windows' run: | cd packages/docsifyjs+docsify/ && git checkout docs/emoji.md src/core/render/emoji-data.js && cd .. && cd .. - git status && git submodule foreach git --no-pager diff && git add . && git diff --quiet && git diff --cached --quiet + git status + git --no-pager diff + git submodule foreach git --no-pager diff + git add . + git diff --quiet && git diff --cached --quiet env: CI: true diff --git a/apps/docs b/apps/docs index 9c5bad096..1bf1b89a0 160000 --- a/apps/docs +++ b/apps/docs @@ -1 +1 @@ -Subproject commit 9c5bad096ea08207ac87670f84c7d9581ba1cb3b +Subproject commit 1bf1b89a047e7df54a1a328a0166ca814fb058e8 diff --git a/dist/cameras/CameraRig.d.ts b/dist/cameras/CameraRig.d.ts index 1e55163bc..be5935638 100644 --- a/dist/cameras/CameraRig.d.ts +++ b/dist/cameras/CameraRig.d.ts @@ -2,7 +2,7 @@ import { type ElementAttributes } from '@lume/element'; import { Element3D, type Element3DAttributes } from '../core/Element3D.js'; import { FlingRotation, ScrollFling, PinchFling } from '../interaction/index.js'; import type { PerspectiveCamera } from './PerspectiveCamera.js'; -export type CameraRigAttributes = Element3DAttributes | 'verticalAngle' | 'minVerticalAngle' | 'maxVerticalAngle' | 'horizontalAngle' | 'minHorizontalAngle' | 'maxHorizontalAngle' | 'distance' | 'minDistance' | 'maxDistance' | 'active' | 'dollySpeed' | 'interactive' | 'dollyEpsilon' | 'dollyScrollLerp' | 'dollyPinchSlowdown' | 'rotationEpsilon' | 'rotationSlowdown' | 'initialPolarAngle' | 'minPolarAngle' | 'maxPolarAngle' | 'initialDistance'; +export type CameraRigAttributes = Element3DAttributes | 'verticalAngle' | 'minVerticalAngle' | 'maxVerticalAngle' | 'horizontalAngle' | 'minHorizontalAngle' | 'maxHorizontalAngle' | 'distance' | 'minDistance' | 'maxDistance' | 'active' | 'dollySpeed' | 'interactive' | 'rotationSpeed' | 'dynamicDolly' | 'dynamicRotation' | 'dollyEpsilon' | 'dollyScrollLerp' | 'dollyPinchSlowdown' | 'rotationEpsilon' | 'rotationSlowdown' | 'initialPolarAngle' | 'minPolarAngle' | 'maxPolarAngle' | 'initialDistance'; /** * @class CameraRig * @@ -217,6 +217,44 @@ export declare class CameraRig extends Element3D { * disabled, but the camera rig can still be manipulated programmatically. */ interactive: boolean; + /** + * @property {number} rotationSpeed + * + * *attribute* + * + * Default: `1` + * + * How much the camera rotates while dragging. + */ + rotationSpeed: number; + /** + * @property {boolean} dynamicDolly + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective dolly speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective dolly speed towards zero. This is useful when zoomed + * into an object and having the dolly movements not be disproportionately + * huge while viewing fine details of the object. + */ + dynamicDolly: boolean; + /** + * @property {boolean} dynamicRotation + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective rotation speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective rotation speed to allow for finer control. This is useful + * zoomed in to see fine details of an object and having the rotation not be + * disproportionately huge, for example when zooming into a 3D globe. + */ + dynamicRotation: boolean; /** * @property {number} dollyEpsilon * diff --git a/dist/cameras/CameraRig.d.ts.map b/dist/cameras/CameraRig.d.ts.map index 338305a32..cf7312564 100644 --- a/dist/cameras/CameraRig.d.ts.map +++ b/dist/cameras/CameraRig.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"CameraRig.d.ts","sourceRoot":"","sources":["../../src/cameras/CameraRig.ts"],"names":[],"mappings":"AAOA,OAAO,EAA6C,KAAK,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAEhG,OAAO,EAAC,SAAS,EAAE,KAAK,mBAAmB,EAAC,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,yBAAyB,CAAA;AAE9E,OAAO,KAAK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BAAoB,SAAM;IAElC;;;;;;;;OAQG;IACe,MAAM,UAAO;IAE/B;;;;;;OAMG;IACc,UAAU,SAAI;IAE/B;;;;;;;;;OASG;IACe,WAAW,UAAO;IAEpC;;;;;;;;OAQG;IACc,aAAa,SAAI;IAElC;;;;;;;;;;;;OAYG;IACe,YAAY,UAAQ;IAEtC;;;;;;;;;;;;OAYG;IACe,eAAe,UAAQ;IAEzC;;;;;;;;;;;OAWG;IACc,YAAY,SAAO;IAEpC;;;;;;;;;OASG;IACc,eAAe,SAAM;IAEtC;;;;;;;;;;OAUG;IACc,kBAAkB,SAAO;IAE1C;;;;;;;;;;OAUG;IACc,eAAe,SAAO;IAEvC;;;;;;;;;;OAUG;IACc,gBAAgB,SAAO;IAEhC,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAEvC,8CAA8C;IAC9C,IAAI,GAAG,kCAEN;IAEO,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,SAAS,CAAA;IAEnC,aAAa,gBAAsB;IACnC,WAAW,cAAoB;IAC/B,UAAU,aAAmB;IAMpB,iBAAiB;IA8HjB,QAAQ,sBAmChB;CACD;AAED,OAAO,QAAQ,UAAU,CAAC;IACzB,UAAU,GAAG,CAAC;QACb,UAAU,iBAAiB;YAC1B,iBAAiB,EAAE,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;SACpE;KACD;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,iBAAiB,EAAE,SAAS,CAAA;KAC5B;CACD"} \ No newline at end of file diff --git a/dist/cameras/CameraRig.js b/dist/cameras/CameraRig.js index c36cc40d6..d252e1614 100644 --- a/dist/cameras/CameraRig.js +++ b/dist/cameras/CameraRig.js @@ -105,6 +105,12 @@ let CameraRig = (() => { let _dollySpeed_initializers = []; let _interactive_decorators; let _interactive_initializers = []; + let _rotationSpeed_decorators; + let _rotationSpeed_initializers = []; + let _dynamicDolly_decorators; + let _dynamicDolly_initializers = []; + let _dynamicRotation_decorators; + let _dynamicRotation_initializers = []; let _dollyEpsilon_decorators; let _dollyEpsilon_initializers = []; let _dollyScrollLerp_decorators; @@ -144,6 +150,9 @@ let CameraRig = (() => { _active_decorators = [booleanAttribute]; _dollySpeed_decorators = [numberAttribute]; _interactive_decorators = [booleanAttribute]; + _rotationSpeed_decorators = [numberAttribute]; + _dynamicDolly_decorators = [booleanAttribute]; + _dynamicRotation_decorators = [booleanAttribute]; _dollyEpsilon_decorators = [numberAttribute]; _dollyScrollLerp_decorators = [numberAttribute]; _dollyPinchSlowdown_decorators = [numberAttribute]; @@ -171,6 +180,9 @@ let CameraRig = (() => { __esDecorate(null, null, _active_decorators, { kind: "field", name: "active", static: false, private: false, access: { has: obj => "active" in obj, get: obj => obj.active, set: (obj, value) => { obj.active = value; } }, metadata: _metadata }, _active_initializers, _instanceExtraInitializers); __esDecorate(null, null, _dollySpeed_decorators, { kind: "field", name: "dollySpeed", static: false, private: false, access: { has: obj => "dollySpeed" in obj, get: obj => obj.dollySpeed, set: (obj, value) => { obj.dollySpeed = value; } }, metadata: _metadata }, _dollySpeed_initializers, _instanceExtraInitializers); __esDecorate(null, null, _interactive_decorators, { kind: "field", name: "interactive", static: false, private: false, access: { has: obj => "interactive" in obj, get: obj => obj.interactive, set: (obj, value) => { obj.interactive = value; } }, metadata: _metadata }, _interactive_initializers, _instanceExtraInitializers); + __esDecorate(null, null, _rotationSpeed_decorators, { kind: "field", name: "rotationSpeed", static: false, private: false, access: { has: obj => "rotationSpeed" in obj, get: obj => obj.rotationSpeed, set: (obj, value) => { obj.rotationSpeed = value; } }, metadata: _metadata }, _rotationSpeed_initializers, _instanceExtraInitializers); + __esDecorate(null, null, _dynamicDolly_decorators, { kind: "field", name: "dynamicDolly", static: false, private: false, access: { has: obj => "dynamicDolly" in obj, get: obj => obj.dynamicDolly, set: (obj, value) => { obj.dynamicDolly = value; } }, metadata: _metadata }, _dynamicDolly_initializers, _instanceExtraInitializers); + __esDecorate(null, null, _dynamicRotation_decorators, { kind: "field", name: "dynamicRotation", static: false, private: false, access: { has: obj => "dynamicRotation" in obj, get: obj => obj.dynamicRotation, set: (obj, value) => { obj.dynamicRotation = value; } }, metadata: _metadata }, _dynamicRotation_initializers, _instanceExtraInitializers); __esDecorate(null, null, _dollyEpsilon_decorators, { kind: "field", name: "dollyEpsilon", static: false, private: false, access: { has: obj => "dollyEpsilon" in obj, get: obj => obj.dollyEpsilon, set: (obj, value) => { obj.dollyEpsilon = value; } }, metadata: _metadata }, _dollyEpsilon_initializers, _instanceExtraInitializers); __esDecorate(null, null, _dollyScrollLerp_decorators, { kind: "field", name: "dollyScrollLerp", static: false, private: false, access: { has: obj => "dollyScrollLerp" in obj, get: obj => obj.dollyScrollLerp, set: (obj, value) => { obj.dollyScrollLerp = value; } }, metadata: _metadata }, _dollyScrollLerp_initializers, _instanceExtraInitializers); __esDecorate(null, null, _dollyPinchSlowdown_decorators, { kind: "field", name: "dollyPinchSlowdown", static: false, private: false, access: { has: obj => "dollyPinchSlowdown" in obj, get: obj => obj.dollyPinchSlowdown, set: (obj, value) => { obj.dollyPinchSlowdown = value; } }, metadata: _metadata }, _dollyPinchSlowdown_initializers, _instanceExtraInitializers); @@ -503,6 +515,82 @@ let CameraRig = (() => { * disabled, but the camera rig can still be manipulated programmatically. */ interactive = __runInitializers(this, _interactive_initializers, true + /** + * @property {number} rotationSpeed + * + * *attribute* + * + * Default: `1` + * + * How much the camera rotates while dragging. + */ + ); + /** + * @property {number} rotationSpeed + * + * *attribute* + * + * Default: `1` + * + * How much the camera rotates while dragging. + */ + rotationSpeed = __runInitializers(this, _rotationSpeed_initializers, 1 + /** + * @property {boolean} dynamicDolly + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective dolly speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective dolly speed towards zero. This is useful when zoomed + * into an object and having the dolly movements not be disproportionately + * huge while viewing fine details of the object. + */ + ); + /** + * @property {boolean} dynamicDolly + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective dolly speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective dolly speed towards zero. This is useful when zoomed + * into an object and having the dolly movements not be disproportionately + * huge while viewing fine details of the object. + */ + dynamicDolly = __runInitializers(this, _dynamicDolly_initializers, false + /** + * @property {boolean} dynamicRotation + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective rotation speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective rotation speed to allow for finer control. This is useful + * zoomed in to see fine details of an object and having the rotation not be + * disproportionately huge, for example when zooming into a 3D globe. + */ + ); + /** + * @property {boolean} dynamicRotation + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective rotation speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective rotation speed to allow for finer control. This is useful + * zoomed in to see fine details of an object and having the rotation not be + * disproportionately huge, for example when zooming into a 3D globe. + */ + dynamicRotation = __runInitializers(this, _dynamicRotation_initializers, false /** * @property {number} dollyEpsilon * @@ -671,6 +759,7 @@ let CameraRig = (() => { flingRotation.maxFlingRotationX = this.maxVerticalAngle; flingRotation.minFlingRotationY = this.minHorizontalAngle; flingRotation.maxFlingRotationY = this.maxHorizontalAngle; + flingRotation.factor = this.rotationSpeed; flingRotation.epsilon = this.rotationEpsilon; flingRotation.slowdownAmount = this.rotationSlowdown; scrollFling.minY = pinchFling.minX = this.__appliedMinDistance; @@ -680,6 +769,37 @@ let CameraRig = (() => { scrollFling.lerpAmount = this.dollyScrollLerp; pinchFling.slowdownAmount = this.dollyPinchSlowdown; }); + this.createEffect(() => { + if (!this.dynamicDolly) + return; + // Dolly speed when position is at minDistance + const minDollySpeed = 0.001; + // Dolly speed when position is at maxDistance + const maxDollySpeed = 2 * this.dollySpeed; + // Scroll sensitivity is linear between min/max dolly speed and min/max distance. + const sens = ((maxDollySpeed - minDollySpeed) / (this.maxDistance - this.minDistance)) * + (this.threeCamera.position.z - this.minDistance) + + minDollySpeed; + scrollFling.sensitivity = sens < minDollySpeed ? minDollySpeed : sens; + }); + this.createEffect(() => { + if (!this.dynamicRotation) + return; + // This only depends on the size of the scene and the FOV of the camera. The only + // issue is the camera's FOV is not reactive and is set by the scene at some point. + // In the case where the camera's FOV is not set yet, use the scene's perspective. + const perspective = this.threeCamera.three.fov + ? this.scene.calculatedSize.y / 2 / Math.tan((this.threeCamera.three.fov * Math.PI) / 360) + : this.scene.perspective; + // Plane positioned at origin facing camera with width equal to `minDistance`. + // `minDistance` is doubled because the expected `minDistance` should barely touch + // the object, whose size would be double `minDistance`. + const planeSize = (perspective * (this.minDistance * 2)) / this.threeCamera.position.z; + const degreesPerPixel = 180 / planeSize; + // Counteract the FlingRotation's delta modifier to get exact angular movement. + const sens = (1 / 0.15) * degreesPerPixel * this.rotationSpeed; + this.flingRotation.factor = sens <= 0 ? 1 : sens; + }); this.createEffect(() => { if (this.interactive && !this.pinchFling?.interacting) flingRotation.start(); @@ -729,7 +849,7 @@ let CameraRig = (() => { comment="We don't set position here because it triggers the pre-upgrade handling due to the template running before perspective-camera is upgraded (due to Solid specifics) which causes the initial value to override the initial position calculated from scene.perspective." xposition=${() => [0, 0, this.__appliedDistance]} align-point="0.5 0.5 0.5" - far="10000" + far="100000" > diff --git a/dist/cameras/CameraRig.js.map b/dist/cameras/CameraRig.js.map index b023f8cb1..d1aa68ba3 100644 --- a/dist/cameras/CameraRig.js.map +++ b/dist/cameras/CameraRig.js.map @@ -1 +1 @@ -{"version":3,"file":"CameraRig.js","sourceRoot":"","sources":["../../src/cameras/CameraRig.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,gFAAgF;AAChF,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAClC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,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GAAG,EAAE,CAAC;;;cAGzC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;;;;UAItC,CAAC,EAAa,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;;eAEzC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;;;;;;;;YAQnC,CAAC,GAAsB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;;eAEjD,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM;;kBAEd,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC;;;;;;;;;;;EAWpD,CAAA;;;;SAtgBI,SAAS"} \ No newline at end of file diff --git a/dist/interaction/FlingRotation.d.ts.map b/dist/interaction/FlingRotation.d.ts.map index 686c4d790..cff4c01c8 100644 --- a/dist/interaction/FlingRotation.d.ts.map +++ b/dist/interaction/FlingRotation.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"FlingRotation.d.ts","sourceRoot":"","sources":["../../src/interaction/FlingRotation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,EAAmB,MAAM,cAAc,CAAA;AAGtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAEnD,KAAK,OAAO,GAAG,OAAO,CACrB,IAAI,CACH,aAAa,EACX,iBAAiB,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,QAAQ,GACR,SAAS,GACT,gBAAgB,CAClB,CACD,CAAA;AAED,qBAEM,aAAc,SAAQ,OAAO;;IAClC,sDAAsD;IAC9C,eAAe,EAAG,SAAS,CAAA;IAEnC;;;OAGG;IACK,eAAe,EAAG,SAAS,CAAA;IAEnC;;;OAGG;IACK,oBAAoB,EAAG,OAAO,CAAA;IAEtC;;;OAGG;IAGK,oBAAoB,EAAE,OAAO,CAA2B;IAEhE;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAM;IAE/B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAK;IAE9B;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAY;IAErC;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAW;IAEpC,MAAM,SAAI;IAEV,OAAO,SAAO;IAEd;;;OAGG;IACH,cAAc,SAAO;gBAIT,OAAO,GAAE,OAAY;IA6GjC,KAAK,IAAI,IAAI;IA0Cb,IAAI,IAAI,IAAI;CAcZ"} \ No newline at end of file +{"version":3,"file":"FlingRotation.d.ts","sourceRoot":"","sources":["../../src/interaction/FlingRotation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,EAAmB,MAAM,cAAc,CAAA;AAGtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAEnD,KAAK,OAAO,GAAG,OAAO,CACrB,IAAI,CACH,aAAa,EACX,iBAAiB,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,QAAQ,GACR,SAAS,GACT,gBAAgB,CAClB,CACD,CAAA;AAED,qBAEM,aAAc,SAAQ,OAAO;;IAClC,sDAAsD;IAC9C,eAAe,EAAG,SAAS,CAAA;IAEnC;;;OAGG;IACK,eAAe,EAAG,SAAS,CAAA;IAEnC;;;OAGG;IACK,oBAAoB,EAAG,OAAO,CAAA;IAEtC;;;OAGG;IAGK,oBAAoB,EAAE,OAAO,CAA2B;IAEhE;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAM;IAE/B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAK;IAE9B;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAY;IAErC;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAW;IAEpC,MAAM,SAAI;IAEV,OAAO,SAAO;IAEd;;;OAGG;IACH,cAAc,SAAO;gBAIT,OAAO,GAAE,OAAY;IAiHjC,KAAK,IAAI,IAAI;IA0Cb,IAAI,IAAI,IAAI;CAcZ"} \ No newline at end of file diff --git a/dist/interaction/FlingRotation.js b/dist/interaction/FlingRotation.js index c2cdf4b34..99dcd4971 100644 --- a/dist/interaction/FlingRotation.js +++ b/dist/interaction/FlingRotation.js @@ -137,6 +137,7 @@ let FlingRotation = (() => { #lastY = 0; #deltaX = 0; #deltaY = 0; + #moveTimestamp = 0; #onPointerDown = (event) => { this.#pointerCount++; if (this.#pointerCount === 1) @@ -156,6 +157,7 @@ let FlingRotation = (() => { #onMove = (event) => { if (event.pointerId !== this.#mainPointer) return; + this.#moveTimestamp = performance.now(); // We're not simply using event.movementX and event.movementY // because of a Safari bug: // https://bugs.webkit.org/show_bug.cgi?id=248119 @@ -179,7 +181,7 @@ let FlingRotation = (() => { // stop dragging // @ts-expect-error, whyyyy TypeScript It says that event type is Event instead of PointerEvent this.interactionContainer.removeEventListener('pointermove', this.#onMove); - if (this.#deltaX === 0 && this.#deltaY === 0) + if ((this.#deltaX === 0 && this.#deltaY === 0) || performance.now() - this.#moveTimestamp > 100) return; // slow the rotation down based on former drag speed this.rotationXTarget.rotation = (x, y, z, _t, dt) => { diff --git a/dist/interaction/FlingRotation.js.map b/dist/interaction/FlingRotation.js.map index 58a636908..57a890b3f 100644 --- a/dist/interaction/FlingRotation.js.map +++ b/dist/interaction/FlingRotation.js.map @@ -1 +1 @@ -{"version":3,"file":"FlingRotation.js","sourceRoot":"","sources":["../../src/interaction/FlingRotation.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,8EAA8E;AAC9E,wDAAwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,MAA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;QACZ,CAAC;QAED,IAAI;YACH,IAAI,CAAC,IAAI,CAAC,UAAU;gBAAE,OAAO,IAAI,CAAA;YACjC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;YAEvB,IAAI,CAAC,WAAW,EAAE,CAAA;YAElB,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,cAAc;YACb,8BAA8B;YAC9B,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,KAAK,CAAA;YAC3C,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,KAAK,CAAA;QAC5C,CAAC;;;;SAtOI,aAAa"} \ No newline at end of file diff --git a/examples/camera-rig.html b/examples/camera-rig.html new file mode 100644 index 000000000..84607efeb --- /dev/null +++ b/examples/camera-rig.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + diff --git a/src/cameras/CameraRig.ts b/src/cameras/CameraRig.ts index 450394ead..f9ebbd150 100644 --- a/src/cameras/CameraRig.ts +++ b/src/cameras/CameraRig.ts @@ -26,6 +26,9 @@ export type CameraRigAttributes = | 'active' | 'dollySpeed' | 'interactive' + | 'rotationSpeed' + | 'dynamicDolly' + | 'dynamicRotation' | 'dollyEpsilon' | 'dollyScrollLerp' | 'dollyPinchSlowdown' @@ -293,6 +296,47 @@ class CameraRig extends Element3D { */ @booleanAttribute interactive = true + /** + * @property {number} rotationSpeed + * + * *attribute* + * + * Default: `1` + * + * How much the camera rotates while dragging. + */ + @numberAttribute rotationSpeed = 1 + + /** + * @property {boolean} dynamicDolly + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective dolly speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective dolly speed towards zero. This is useful when zoomed + * into an object and having the dolly movements not be disproportionately + * huge while viewing fine details of the object. + */ + @booleanAttribute dynamicDolly = false + + /** + * @property {boolean} dynamicRotation + * + * *attribute* + * + * Default: `false` + * + * When `true`, the effective rotation speed will be changed based on the + * camera's distance to `minDistance`. Getting closer to `minDistance` will + * lower the effective rotation speed to allow for finer control. This is useful + * zoomed in to see fine details of an object and having the rotation not be + * disproportionately huge, for example when zooming into a 3D globe. + */ + @booleanAttribute dynamicRotation = false + /** * @property {number} dollyEpsilon * @@ -427,6 +471,7 @@ class CameraRig extends Element3D { flingRotation.maxFlingRotationX = this.maxVerticalAngle flingRotation.minFlingRotationY = this.minHorizontalAngle flingRotation.maxFlingRotationY = this.maxHorizontalAngle + flingRotation.factor = this.rotationSpeed flingRotation.epsilon = this.rotationEpsilon flingRotation.slowdownAmount = this.rotationSlowdown @@ -438,6 +483,46 @@ class CameraRig extends Element3D { pinchFling.slowdownAmount = this.dollyPinchSlowdown }) + this.createEffect(() => { + if (!this.dynamicDolly) return + + // Dolly speed when position is at minDistance + const minDollySpeed = 0.001 + + // Dolly speed when position is at maxDistance + const maxDollySpeed = 2 * this.dollySpeed + + // Scroll sensitivity is linear between min/max dolly speed and min/max distance. + const sens = + ((maxDollySpeed - minDollySpeed) / (this.maxDistance - this.minDistance)) * + (this.threeCamera!.position.z - this.minDistance) + + minDollySpeed + + scrollFling.sensitivity = sens < minDollySpeed ? minDollySpeed : sens + }) + this.createEffect(() => { + if (!this.dynamicRotation) return + + // This only depends on the size of the scene and the FOV of the camera. The only + // issue is the camera's FOV is not reactive and is set by the scene at some point. + // In the case where the camera's FOV is not set yet, use the scene's perspective. + const perspective = this.threeCamera!.three.fov + ? this.scene!.calculatedSize.y / 2 / Math.tan((this.threeCamera!.three.fov * Math.PI) / 360) + : this.scene!.perspective + + // Plane positioned at origin facing camera with width equal to `minDistance`. + // `minDistance` is doubled because the expected `minDistance` should barely touch + // the object, whose size would be double `minDistance`. + const planeSize = (perspective * (this.minDistance * 2)) / this.threeCamera!.position.z + + const degreesPerPixel = 180 / planeSize + + // Counteract the FlingRotation's delta modifier to get exact angular movement. + const sens = (1 / 0.15) * degreesPerPixel * this.rotationSpeed + + this.flingRotation.factor = sens <= 0 ? 1 : sens + }) + this.createEffect(() => { if (this.interactive && !this.pinchFling?.interacting) flingRotation.start() else flingRotation.stop() @@ -487,7 +572,7 @@ class CameraRig extends Element3D { comment="We don't set position here because it triggers the pre-upgrade handling due to the template running before perspective-camera is upgraded (due to Solid specifics) which causes the initial value to override the initial position calculated from scene.perspective." xposition=${() => [0, 0, this.__appliedDistance]} align-point="0.5 0.5 0.5" - far="10000" + far="100000" > diff --git a/src/interaction/FlingRotation.ts b/src/interaction/FlingRotation.ts index 757736e76..28421b2de 100644 --- a/src/interaction/FlingRotation.ts +++ b/src/interaction/FlingRotation.ts @@ -105,6 +105,8 @@ class FlingRotation extends Effects { #deltaX = 0 #deltaY = 0 + #moveTimestamp = 0 + #onPointerDown = (event: PointerEvent) => { this.#pointerCount++ if (this.#pointerCount === 1) this.#mainPointer = event.pointerId @@ -128,6 +130,8 @@ class FlingRotation extends Effects { #onMove = (event: PointerEvent) => { if (event.pointerId !== this.#mainPointer) return + this.#moveTimestamp = performance.now() + // We're not simply using event.movementX and event.movementY // because of a Safari bug: // https://bugs.webkit.org/show_bug.cgi?id=248119 @@ -165,7 +169,7 @@ class FlingRotation extends Effects { // @ts-expect-error, whyyyy TypeScript It says that event type is Event instead of PointerEvent this.interactionContainer.removeEventListener('pointermove', this.#onMove) - if (this.#deltaX === 0 && this.#deltaY === 0) return + if ((this.#deltaX === 0 && this.#deltaY === 0) || performance.now() - this.#moveTimestamp > 100) return // slow the rotation down based on former drag speed this.rotationXTarget.rotation = (x, y, z, _t, dt) => {