Small World Engine API Reference - v0.46.1
    Preparing search index...

    Interface CameraStrategy

    Interface for camera control strategies (e.g. FPS, Orbit, Smooth).

    interface CameraStrategy {
        constraints?: CameraConstraints;
        type: string;
        update(
            camera: CameraInterfaceData,
            targetPos: Vector3D,
            dx: number,
            dy: number,
        ): void;
        zoom?(camera: CameraInterfaceData, delta: number): boolean;
    }

    Implemented by

    Index

    Properties

    Methods

    Properties

    constraints?: CameraConstraints

    Optional spatial constraints for the camera.

    type: string

    The unique type identifier of the strategy.

    Methods

    • Updates the camera position and target based on the strategy's logic.

      Parameters

      • camera: CameraInterfaceData

        The camera to update.

      • targetPos: Vector3D

        The target position to follow.

      • dx: number

        The horizontal rotation delta.

      • dy: number

        The vertical rotation delta.

      Returns void