yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

Home Page:https://yomotsu.github.io/camera-controls/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dolly to cursor does not maintain steady speed

WebPixel-it opened this issue · comments

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

Might be related to #497