webani - v1.0.0
    Preparing search index...

    A class representing a perspective camera in a 3D environment. It extends from WebaniTransformable to support position, rotation, and other transformations.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Optional animation class used for interpolated animations.

    Type declaration

    extraTransforms: WorldTransform[] = []

    An array of additional world transforms that modify the object.

    far: number

    The far plane distance for the camera.

    fov: number

    The field of view of the camera.

    near: number

    The near plane distance for the camera.

    The parent transformable object, if any.

    scaleCompensation: boolean = false

    Flag indicating whether to apply scale compensation for the parent object.

    transform: WorldTransform = ...

    The world transform of the object, including position, rotation, and scale.

    useOriginAsCenter: boolean = false

    Flag indicating whether to use the origin as the center of rotation.

    Accessors

    • get extraTransformsMatrixWithoutScale(): Matrix4

      The combined matrix of all extra transforms without scale compensation.

      Returns Matrix4

      A Matrix4 object representing the combined matrix of all extra transforms.

    • get shallowCopy(): this

      Creates a shallow copy of the WebaniTransformable object.

      Returns this

      A new instance of WebaniTransformable with the same properties as the current object.

    Methods

    • Computes the projection matrix for the camera, given the screen dimensions.

      Parameters

      • screenWidth: number

        The width of the screen.

      • screenHeight: number

        The height of the screen.

      Returns Matrix4

      A Matrix4 representing the projection matrix.