@3dsource/metabox-front-api
    Preparing search index...

    Class SetCamera

    Represents a command to set the camera configuration. This class sends a message to the Metabox API to set the camera on a scene. Important: No need to listen to any events to see changes.

    Sets camera presets with restriction parameters (FOV, rotation, position).

    Sets camera with precise control: fov (degrees), mode ('orbit'|'fps'), position ({x,y,z}), rotation ({horizontal,vertical}), and restrictions (min/max distance, FOV, rotation bounds). Use for guided tours, preset view buttons, or restricting camera to prevent users seeing behind the product.

    Only include fields you want to change — omitted values keep current settings. Use orbit mode for typical product viewing, fps for walkthrough/room scenes. Apply restrictions to prevent bad angles. Full interface: {fov?, mode?, position?, rotation?, restrictions?}.

    import { SetCamera, Communicator } from '@3dsource/metabox-front-api';
    window.env3DSource.apiReady = (api: Communicator) => {
    api.sendCommandToMetabox(new SetCamera({
    fov: 45,
    mode: 'orbit',
    position: { x: 100, y: 100, z: 100 },
    rotation: { horizontal: 0, vertical: 0 },
    restrictions: {
    maxDistanceToPivot: 0,
    maxFov: 0,
    maxHorizontalRotation: 0,
    maxVerticalRotation: 0,
    minDistanceToPivot: 0,
    minFov: 0,
    minHorizontalRotation: 0,
    minVerticalRotation: 0,
    },
    }));
    };

    The camera configuration.

    Index

    Constructors

    Properties

    Constructors

    Properties

    data: ToMetaBoxMessageEnvelope

    The message envelope populated by subclass constructors and sent via Communicator.sendCommandToMetabox.