Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Nov 28, 2024

Description

This allows for setting a different speed of rotation when using the keyboard vs when using a mouse. Similar in approach to the existing keyPanSpeed.

This allows for setting a different speed of rotation when using the
keyboard vs when using a mouse. Similar in approach to the existing
keyPanSpeed.
@ghost ghost changed the title feat(OrbitControls): Add keyRotateSpeed feat(OrbitControls): Add keyRotateSpeed to have different rotation speed when navigating with a keyboard Nov 28, 2024
@@ -92,6 +92,7 @@ class OrbitControls extends Controls {
// Set to false to disable rotating
this.enableRotate = true;
this.rotateSpeed = 1.0;
this.keyRotateSpeed = 10.0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you mind not changing the default value so we don't change the behavior?

Copy link
Author

Choose a reason for hiding this comment

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

Happy to change this default to 1 as it's now configurable. But .. The default of 1 is fairly slow when moving with the keyboard. Having a slightly faster speed, would be similar to keyPanSpeed which is also higher when using the keyboard (7 vs 1).

The following recordings is me just holding shift+ down, so no repeated presses:

keyRotateSpeed = 1

key-rotate-1.mov

keyRotateSpeed = 10

key-rotate-10.mov

Let me know what you think, happy to go either way on this

Copy link
Collaborator

Choose a reason for hiding this comment

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

Um, at least on my macMini the the rotate speed feels a bit too high.

TBH, I feel more safe if we don't touch the default value. Is that okay for you?

Copy link
Author

Choose a reason for hiding this comment

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

No worries at all, I pushed a commit which sets it to 1

@Mugen87 Mugen87 changed the title feat(OrbitControls): Add keyRotateSpeed to have different rotation speed when navigating with a keyboard OrbitControls: Add keyRotateSpeed. Nov 29, 2024
@Mugen87 Mugen87 added this to the r171 milestone Nov 29, 2024
@mrdoob mrdoob modified the milestones: r171, r172 Nov 29, 2024
@Mugen87 Mugen87 merged commit d9c9920 into mrdoob:dev Nov 29, 2024
11 checks passed
cmhhelgeson pushed a commit to cmhhelgeson/three.js that referenced this pull request Dec 5, 2024
* feat: Add keyRotateSpeed to OrbitControls

This allows for setting a different speed of rotation when using the
keyboard vs when using a mouse. Similar in approach to the existing
keyPanSpeed.

* fix: reduce keyRotateSpeed down to 1
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.

3 participants