@kognifai/cogsengine
    Preparing search index...

    Class CameraHelper

    Contains common utility members for camera setup Other camera utilities: Interpolation utilities can be found in: Cogs.Foundation/Geometry/EasingFn.h Cogs.Foundation/Geometry/Interpolator.h Cogs.Foundation/Geometry/Interpolation.hpp

    Component: CinematicCameraComponent Library: gl-matrix

    Index

    Constructors

    Methods

    • Calculate a vector pointing in camera direction given the camera orientation.

      Parameters

      • orientation: quat

        Camera rotation

      Returns vec3

      Camera direction

    • Returns the position of a camera with the given orientation looking at the given targetPosition from the given distance.

      Parameters

      • targetPosition: dvec3

        The target's position

      • cameraOrientation: quat

        The orientation of the camera.

      • distance: number

        The calculated distance from the camera to the target

      Returns dvec3

      Position of the camera

    • Gets camera far distance given camera position and scene bounding box.

      Parameters

      Returns number

      far distance

    • Gets distance from given position (camera position) to center of bounding box.

      Parameters

      Returns number

      focal distance

    • Returns the camera's horizontal angle from the given orientation. Can be used to control the OrbitingCameraController.

      Parameters

      • cameraOrientation: quat

        The orientation of the camera.

      Returns number

      horizontal angle

    • Gets the camera orientation from the horizontal and vertical angle values.

      Parameters

      • horizontalAngle: number

        Horizontal rotation angle

      • verticalAngle: number

        Vertical rotation Angle

      Returns quat

      Camera direction

    • Calculate Orthographic camera orthoHeight Field to view bounding box.

      Parameters

      Returns number

      Orthographic camera orthoHeight

    • Gets the radius of the sphere enclosing the bounding box.

      Parameters

      Returns number

      radius

    • Returns a target position given camera position, target position and distance

      Parameters

      • cameraPosition: dvec3

        The position of the camera

      • cameraOrientation: quat

        The orientation of the camera.

      • distance: number

        The calculated distance from the camera to the target

      Returns dvec3

      Position of the target

    • Returns the camera's vertical angle from the given orientation. Can be used to control the OrbitingCameraController.

      Parameters

      • cameraOrientation: quat

        The orientation of the camera.

      Returns number

      vertical angle

    • Calculates a camera position where bounding box given is shown on the screen.

      2D viewport defaults to 0.0f, which would result in an assumed aspect ratio of 1.0f. Use the actual width and height, in pixels, of the 3D view to use the correct aspect ratio in calculations.

      Parameters

      • boundingBox: DBoundingBox

        Must be a bounding box with hasExtent(BoundingBoxType box)

      • orientation: quat

        Camera orientation

      • fieldOfView: number

        Camera field of view (also used in ortho camera).

      • viewport: vec2

        Width/Height in pixels of the 3D view

      Returns dvec3

      New Camera Position