locar
    Preparing search index...

    Class App

    Application class to orchestrate the interaction between the individual LocAR classes and the Three.js camera, renderer and scene.

    Hierarchy (View Summary)

    Index
    • Create an App object.

      Parameters

      • -: AppOptions

        Startup options. Note that you can only specify ONE of cameraOptions and threeObjects, as cameraOptions is intended to configure a new three.js camera, while threeObjects allows you to specify an existing camera, renderer and scene.

      Returns App

    camera: PerspectiveCamera
    cameraFeedDimensions: { landHeight: number; landWidth: number } | null
    deviceOrientationControls: DeviceOrientationControls | null
    eventHandlers: Record<string, ((...args: any[]) => void)[]>
    locar: LocAR
    origHfov: number
    renderer: WebGLRenderer
    scene: Scene
    webcam: Webcam
    • Remove an event handler.

      Parameters

      • eventName: string

        the event to remove a handler from.

      • eventHandler: (...args: any[]) => void

        the event handler function to remove.

      Returns void

    • Add an event handler. Overridden from EventEmitter to create a ClickHandler for objectsIntersected event.

      Parameters

      • eventName: string

        the event to handle.

      • eventHandler: (...args: any[]) => void

        the event handler function.

      Returns void

    • Start the app. Must be called after construction.

      Returns Promise<LocAR>

      Promise resolving with LocAR object. Rejects with object containing code and message.