Define the interface of CameraService.

interface ICameraService {
    activeCamera: null | Entity;
    canRotate: boolean;
    canSwitchPov: boolean;
    canZoom: boolean;
    isUsingExternalCamera: boolean;
    maxZoomDistance: number;
    minZoomDistance: number;
    pov: PovTypes;
    addLayer(layerId: number, order?: number): void;
    removeLayer(layerId: number): void;
    switchCamera(camera?: Entity): void;
    switchPov(pov: PovTypes): void;
}

Implemented by

Properties

activeCamera: null | Entity

Retrieve the current active camera.

canRotate: boolean

Control whether the VIVERSE CREATE Camera can rotate or not.

canSwitchPov: boolean

Control whether the camera's point of view can switch or not.

canZoom: boolean

Control whether the VIVERSE CREATE Camera can zoom or not.

isUsingExternalCamera: boolean

Retrieve the activation status of the Camera that was uploaded by the user.

maxZoomDistance: number

Control the maximum distance between the VIVERSE CREATE third-person camera and the player.

minZoomDistance: number

Control the minimum distance between the VIVERSE CREATE third-person camera and the player.

Retrieve the current camera's point of view.

Methods

  • Add the layer to the default camera in VIVERSE CREATE.

    Parameters

    • layerId: number

      Layer ID

    • Optionalorder: number

      Layer sorting: By default, it will be placed last.

    Returns void

  • Remove the layer from the default camera in VIVERSE CREATE.

    Parameters

    • layerId: number

      Layer ID

    Returns void

  • Switch the perspective to the provided camera.
    If no camera is provided, revert to the default camera mechanism in VIVERSE CREATE.

    Parameters

    • Optionalcamera: Entity

      This Entity must include the pc.CameraComponent.

    Returns void

  • Switch the point of view of the camera.

    Parameters

    Returns void