Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera controls updates #7205

Merged
merged 27 commits into from
Jan 14, 2025
Merged

Camera controls updates #7205

merged 27 commits into from
Jan 14, 2025

Conversation

kpal81xd
Copy link
Contributor

@kpal81xd kpal81xd commented Dec 17, 2024

Overview

  • Attribute refactor
  • Added zoomDamping separate from rotateDamping and moveDamping
  • Emits events clamp:position and clamp:look for more complex restriction of camera controls such as setting custom bounds
  • Checks for double attach and detach calls (Used for disabling controls to prioritize other events)

Examples

  • Updated examples and controls for multi/fly/orbit for renamed attributes
  • Replaced editor example orbit camera with camera controls
  • Fixed touch control issues on mobile

@kpal81xd kpal81xd self-assigned this Dec 17, 2024
@kpal81xd kpal81xd changed the title [BETA] Multi camera movement bounds Camera controls position and look clamping Jan 13, 2025
@kpal81xd kpal81xd requested a review from a team January 13, 2025 14:36
@kpal81xd kpal81xd marked this pull request as ready for review January 13, 2025 14:36
@kpal81xd kpal81xd requested a review from slimbuck January 13, 2025 14:46
@vincentwoo
Copy link
Contributor

I'm very interested in an easy to use option for the basic camera-controls that allow for clamping the camera within a radius of the origin (or defined point) as well as keeping it above the ground plane, in case that's on the menu!

@kpal81xd
Copy link
Contributor Author

I'm very interested in an easy to use option for the basic camera-controls that allow for clamping the camera within a radius of the origin (or defined point) as well as keeping it above the ground plane, in case that's on the menu!

So by using a callback on the camera clamp:position event you can adjust the position to keep it within bounds. I had originally had a more verbose attempt (can look over previous commits) however it seemed very bloated for its function and this solution keeps the script lean.

@kpal81xd kpal81xd changed the title Camera controls position and look clamping Camera controls updates Jan 14, 2025
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

Looks good to me.
I'm typically used to dumping work the opposite way, a larger value would stop the rotation quicker, but this works as well.

@kpal81xd kpal81xd merged commit 50764c5 into main Jan 14, 2025
7 checks passed
@kpal81xd kpal81xd deleted the multi-camera branch January 14, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants