@kognifai/cogsengine
    Preparing search index...

    Class CameraUtils

    Contains common operations for camera setup. Supports camera with default setup and camera with OrbitingCameraController component added. Uses:

    CameraHelper for calculation.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • View all for given bounding box. Ensures a sphere enclosing the bounding box is visible. Updates passed camera. Updated cameraComponent.farDistance is extended if needed to include bounds (Near Distance not changed).

      Parameters

      • cameraComponent: CameraComponent

        CameraComponent of the selected camera.

      • transformComponent: TransformComponent

        TransformComponent of the selected camera.

      • orbitingCameraController: OrbitingCameraController

        Optional OrbitingCameraController component of the camera.

      • boundingBox: DBoundingBox

        Bounding box to focus on. Must have Extents.

      • viewport: vec2

        Optional viewport in pixels of window (0,0) for none.

      Returns dvec3

      Calculated Position of the camera.

    • View all for given bounding box. Ensures a sphere enclosing the bounding box is visible. Update passed components. Either in CameraComponent/TransformComponent or OrbitingCameraController/CameraComponent. Updated cameraComponent.farDistance is extended if needed to include bounds (Near Distance not changed).

      Parameters

      • camera: Camera

        Camera to update

      • boundingBox: DBoundingBox

        Bounding box to focus on. Must have Extents.

      • viewport: vec2

        Optional viewport in pixels of window (0,0) for none.

      Returns dvec3

      Calculated Position of the camera.