yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.
https://yomotsu.github.io/camera-controls/
MIT License
2.05k stars 256 forks source link

Dolly to cursor does not maintain steady speed #499

Open WebPixel-it opened 7 months ago

WebPixel-it commented 7 months ago

Describe the bug

The InfinityDolly is very helpful and has the functionality I need to orbit a model like orbit controls, but also navigate inside it like a drone. It's working as needed but can I keep dollySpeed steady?

If I'm dollying to cursor from x -15 to x +15 with the target at 0 ( or any point in between), it is steady until it reaches the target, then it speeds up to cursor very quickly.

To Reproduce

Steps to reproduce the behavior:

  1. Go to x -15
  2. Turn model to view x axis at 45 degrees and point to x +15
  3. Scroll to cursor
  4. Dolly maintains a steady speed specified on settings until it reaches the target (near 0), then jumps to other end of the x axis very quickly

Version 2.2.1

Code

cameraControls.minDistance = 4;
cameraControls.maxDistance = 25;
cameraControls.dollyToCursor = true;
cameraControls.infinityDolly = true;
cameraControls.dollySpeed = 0.7;

Live example

No response

Expected behavior

Steady speed on scroll

Screenshots or Video

No response

Device

Desktop

OS

Windows

Browser

Firefox

sguimmara commented 5 months ago

Might be related to #497