Skip to content

Conversation

@AmoebaChant
Copy link
Contributor

@AmoebaChant AmoebaChant commented Dec 6, 2025

When zoomed in close to a model, the sandbox code will increase the panning sensitivity so that small mouse motions don't result in large unexpected camera movement. However, if you get very close to a model, the check to see if the inertia should be clamped to zero would start clamping all slow user movement to zero. Then when the user moved slightly faster, all of a sudden it wouldn't hit the clamp, and it would feel like it sped up unexpectedly all of a sudden.

With this fix, we scale the _panningEpsilon along with the panningSensibility, so that Epsilon get smaller when the sensitivity gets very high, allowing for inertia to continue until the movement is a 10th of the minimum distance the user can pan in a single frame.

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

// Ensure the panning epsilon is always small enough (no bigger than a 10th of the smallest amount
// of movement the user can cause) so that even when the panningSensibility is very high and the
// user pans very slowly, we can still get inertia during the pan without it being clamped to 0 too quickly.
camera._panningEpsilon = Math.min(Epsilon, 1 / camera.panningSensibility / 10);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe _panningEpsilon shouldn't be an underscore variable or maybe it should also update when panningSensibility is updated.

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17541/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17541/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17541/merge/?snapshot=refs/pull/17541/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants