We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc14480 commit 6ea077eCopy full SHA for 6ea077e
packages/chili-three/src/cameraController.ts
@@ -56,10 +56,11 @@ export class CameraController implements ICameraController {
56
}
57
58
pan(dx: number, dy: number): void {
59
+ let ratio = 0.002 * this.#target.distanceTo(this.#position);
60
let direction = this.#target.clone().sub(this.#position).normalize();
61
let hor = direction.clone().cross(this.#up).normalize();
62
let ver = hor.clone().cross(direction).normalize();
- let vector = hor.multiplyScalar(-dx).add(ver.multiplyScalar(dy));
63
+ let vector = hor.multiplyScalar(-dx).add(ver.multiplyScalar(dy)).multiplyScalar(ratio);
64
this.#target.add(vector);
65
this.#position.add(vector);
66
0 commit comments