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

CameraControls (previously MultiCamera) #7111

Merged
merged 39 commits into from
Nov 19, 2024
Merged

CameraControls (previously MultiCamera) #7111

merged 39 commits into from
Nov 19, 2024

Conversation

kpal81xd
Copy link
Contributor

@kpal81xd kpal81xd commented Nov 14, 2024

N.B. Requires model viewer patch

CameraControls updates

Attributes

  • Added attributes to enable orbit/fly/pan controls enableOrbit: boolean; enablePan: boolean; enableFly: boolean
  • Added attribute focusPoint: Vec3 for setting the camera focus point
  • Added attribute pitchRange: Vec2 for setting the camera pitch range
  • Modified attributes zoomMin: number and zoomMax: number to have no upper bound by default (zoomMax <= zoomMin indicates no maximum zoom)

Methods

  • Added smooth: boolean parameter to focus and resetZoom
  • Added refocus method for simpler focusing API refocus(point: Vec3, start?: Vec3 | null = null, zoomDist?: number | null = null, smoothed: boolean = true)

Other

  • Set default focus to use camera position as start and origin as focus point
  • Folded base camera into child class
  • Renamed MultiCamera to CameraControls

Examples updates

  • Increased examples panel width
  • Updated multi-camera examples controls bounds
  • Replaced orbit and fly camera examples with new camera controls example

Preview

image

@kpal81xd kpal81xd changed the title Multicam API updates MultiCamera API updates Nov 14, 2024
@willeastcott
Copy link
Contributor

willeastcott commented Nov 14, 2024

Feedback:

  • pitch should go from 90 looking down y axis to -90 looking up y axis.
  • focus attribute doesn't stick if applied after the script create.

@willeastcott
Copy link
Contributor

Suggestion: rename from MultiCamera to the more generic and obvious CameraControls.

@kpal81xd kpal81xd changed the title CameraControls (previously MultiCamera) API updates CameraControls (previously MultiCamera) Nov 15, 2024
Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

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

Very cool!

@kpal81xd kpal81xd merged commit f09252f into main Nov 19, 2024
8 checks passed
@kpal81xd kpal81xd deleted the multicam-api branch November 19, 2024 12:00
This was referenced Nov 19, 2024
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