Class: CameraManagerHelper
Helper methods for implementing a camera manager.
Constructors
new CameraManagerHelper()
new CameraManagerHelper():
CameraManagerHelper
Returns
Methods
calculateCameraStateToFitBoundingBox()
staticcalculateCameraStateToFitBoundingBox(camera,boundingBox,radiusFactor):object
Calculates camera position and target that allows to see the content of provided bounding box.
Parameters
• camera: PerspectiveCamera
Used camera instance.
• boundingBox: Box3
Bounding box to be fitted.
• radiusFactor: number = 2
The ratio of the distance from camera to center of box and radius of the box.
Returns
object
position
position:
Vector3
target
target:
Vector3
Defined in
packages/camera-manager/src/CameraManagerHelper.ts:111
calculateNewRotationFromTarget()
staticcalculateNewRotationFromTarget(camera,newTarget):Quaternion
Calculates camera rotation from target
Parameters
• camera: PerspectiveCamera
Used Camera instance
• newTarget: Vector3
The target to compute rotation from
Returns
Quaternion
New camera rotationg
Defined in
packages/camera-manager/src/CameraManagerHelper.ts:70
calculateNewTargetFromRotation()
staticcalculateNewTargetFromRotation(camera,rotation,currentTarget,position):Vector3
Calculates camera target based on new camera rotation.
Parameters
• camera: PerspectiveCamera
Used camera instance.
• rotation: Quaternion
New camera rotation in quaternion form.
• currentTarget: Vector3
Current camera target.
• position: Vector3
New camera position.
Returns
Vector3
Defined in
packages/camera-manager/src/CameraManagerHelper.ts:43
updateCameraNearAndFar()
staticupdateCameraNearAndFar(camera,boundingBox):void
Updates near and far plane of the camera based on the bounding box.
Parameters
• camera: PerspectiveCamera
Used camera instance.
• boundingBox: Box3
Bounding box of all objects on the scene.
Returns
void