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

    Interface ProximitySensorOptions

    Configuration options for the ProximitySensorBehavior.

    interface ProximitySensorOptions {
        minDistance?: number;
        onUpdate: (factor: number, distance: number, deltaTime: number) => void;
        radius: number;
        targetObj: CameraInterfaceData | Object3D;
    }
    Index

    Properties

    minDistance?: number

    The inner distance at which the factor reaches 1.0. Defaults to 0.0.

    onUpdate: (factor: number, distance: number, deltaTime: number) => void

    Callback executed every frame with the normalized proximity factor (0.0 to 1.0).

    radius: number

    The outer distance at which the factor starts rising above 0.0.

    The target object to measure distance to. Can be an Object3D or a Camera (CameraInterfaceData).