Create a new CameraManager
Initial aspect ratio (width / height)
Camera configuration
Get the currently active camera
Get the perspective camera
Get the orthographic camera
Check if currently using orthographic camera
Get current camera type
Toggle between perspective and orthographic camera
Optionalcontrols: anyOptional OrbitControls to update
The new active camera
Reset camera to initial position and target
Optionalcontrols: anyOptional OrbitControls to update
Set initial camera position (for reset)
New initial position
Set initial target position (for reset)
New initial target
Update both cameras for the current position/target Useful when programmatically moving the camera
New camera position
Optionaltarget: Vector3New target position
Optionalcontrols: anyOptional controls to update
Handle window resize - updates both cameras
New width in pixels
New height in pixels
Save current camera state
Optionalcontrols: anyOptional controls to save target from
CameraState object
Restore camera state
CameraState to restore
Optionalcontrols: anyOptional controls to update
Get the initial position
Get the initial target
Calculate optimal camera distance for a given bounding box
The bounding box to frame
Optional padding factor (default 1.2)
Optimal camera distance
Frame a bounding box - positions camera to view entire box
The bounding box to frame
Optionalcontrols: anyOptional controls to update
Optional padding factor (default 1.2)
Dispose of cameras (cleanup)
PrivateperspectivePrivateorthographicPrivateactivePrivateisPrivateinitialPrivateinitialPrivatefrustumPrivatecurrent
CameraManager - Manages dual camera system (perspective + orthographic)
Example usage: