Documentation - v20.0.0-dev
    Preparing search index...

    Controller of the SceneSprites: their engine sprites are in the engine scene's SpriteController, which draws, bounds and picks them. Its visible hides them without changing their own visibility.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _objects: Map<string, SceneSprite> = ...
    _viewer: Viewer
    isSceneObjectController: true
    signals: {
        onObjectAdded: Signal<(object: SceneSprite) => void>;
        onObjectRemoved: Signal<(object: SceneSprite) => void>;
        onObjectSelectedChanged: Signal<(object: SceneSprite) => void>;
        onObjectUpdated: Signal<(object: SceneSprite) => void>;
        onObjectVisibilityChanged: Signal<(object: SceneSprite) => void>;
        onVisibilityChanged: Signal<() => void>;
    } = ...

    Type Declaration

    • onObjectAdded: Signal<(object: SceneSprite) => void>
    • onObjectRemoved: Signal<(object: SceneSprite) => void>
    • onObjectSelectedChanged: Signal<(object: SceneSprite) => void>

      One of its objects is selected or unselected (SceneObject.selected).

    • onObjectUpdated: Signal<(object: SceneSprite) => void>
    • onObjectVisibilityChanged: Signal<(object: SceneSprite) => void>

      One of its objects is shown or hidden (SceneObject.visible).

    • onVisibilityChanged: Signal<() => void>

    Accessors

    • get count(): number

      Controller objects count

      Returns number

    • get firstObject(): TObject | null

      Returns TObject | null

    • get uuids(): MapIterator<string>

      Iterator over all the uuids contained in the controller.

      Returns MapIterator<string>

    • get visible(): boolean

      Returns boolean

    • set visible(value: boolean): void

      Controller visibility (independant from object own visibility).

      Hiding a controller will hide all its children without modifying their own visibility.

      Parameters

      • value: boolean

      Returns void

    Methods

    • To be implemented by controllers to set global visibility (at controller level)

      Parameters

      • value: boolean

      Returns void

    • Adds the given object to the controller. Controllers may not support object hierarchy.

      Parameters

      • object: SceneSprite

        The object to add.

      • parentUuid: string | null

        The parent uuid of the object if the controller supports it.

      Returns void

    • Whether count objects more can be added: always, but where a limit holds (e.g. planes).

      Parameters

      • count: number

      Returns boolean

    • Clears all objects from the controller

      Returns void

    • Makes a sprite, its engine sprite in the engine scene, empty until its image is set (SceneSprite.setTexture); add it to show it.

      Parameters

      • position: Vector3
      • scale: Vector2

        Its width and height, in world units.

      • OptionalclickCallback: () => void
      • layer: MeshLayer = MeshLayer.Layer1

        The layer it is drawn in (Layer1 by default): Layer4 draws it over every object.

      Returns SceneSprite

    • Removes its sprites' engine sprites from the engine scene, then disposes them.

      Returns void

    • The uuids of the hidden objects of this controller.

      Returns string[]

    • The uuids of the objects of this controller: the iterator of its map, no copy.

      Returns MapIterator<string>

    • The uuids of the visible objects of this controller.

      Returns string[]

    • The objects of these uuids, in their order; the unknown uuids left out.

      Parameters

      • uuids: Iterable<string>

      Returns SceneSprite[]

    • Returns whether the controller has the given uuid

      Parameters

      • uuid: string

      Returns boolean

    • Appends where a ray hits its objects drawn outside the engine to target, those options.filter keeps; none by default. Its engine objects (meshes, sprites, planes) are hit by ViewerRaycaster.raycast, which calls it: a controller drawing objects of its own overrides it.

      Parameters

      • ray: Ray

        World frame.

      • camera: Camera

        The camera the ray goes through, its world matrices as last drawn.

      • options: ViewerRaycastOptions

        The query's options.

      • target: SceneIntersection[]

        The hits of the query, appended to (the raycaster sorts them).

      Returns void