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

    Class SceneMeshController<TMesh>Abstract

    Base controller of meshes: its objects' engine objects are in the engine scene's MeshController, which draws, bounds and picks them. Its visible hides them, and its renderState draws them all x-ray, without faces or without edges, without changing their own state.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _objects: Map<string, TMesh> = ...
    _viewer: Viewer
    ignoreViewportRenderMode: false

    Indicates whether the mesh controller should ignore the render mode changes of the viewport

    isSceneMeshController: true
    isSceneObjectController: true
    signals: {
        onObjectAdded: Signal<(object: TMesh) => void>;
        onObjectRemoved: Signal<(object: TMesh) => void>;
        onObjectSelectedChanged: Signal<(object: TMesh) => void>;
        onObjectUpdated: Signal<(object: TMesh) => void>;
        onObjectVisibilityChanged: Signal<(object: TMesh) => void>;
        onVisibilityChanged: Signal<() => void>;
    } = ...

    Type Declaration

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

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

    • onObjectUpdated: Signal<(object: TMesh) => void>
    • onObjectVisibilityChanged: Signal<(object: TMesh) => 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 renderState(): MeshRenderState

      How all its objects are drawn, over each one's own state (see MeshRenderState).

      Returns MeshRenderState

    • 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

    • Returns {
          onObjectAdded: Signal<(object: TMesh) => void>;
          onObjectRemoved: Signal<(object: TMesh) => void>;
          onObjectSelectedChanged: Signal<(object: TMesh) => void>;
          onObjectUpdated: Signal<(object: TMesh) => void>;
          onObjectVisibilityChanged: Signal<(object: TMesh) => void>;
          onVisibilityChanged: Signal<() => void>;
      }

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

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

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

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

      • onVisibilityChanged: Signal<() => void>
    • 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: TMesh

        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

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

      Returns void

    • Removes the object's engine objects from the engine scene, then disposes it.

      Parameters

      Returns void

    • The uuids of the hidden objects of this controller.

      Returns string[]

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

      Returns MapIterator<TMesh>

    • 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[]

    • Returns the object associated with the given uuid if found

      Parameters

      • uuid: string

      Returns TMesh | null

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

      Parameters

      • uuids: Iterable<string>

      Returns TMesh[]

    • 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

    • Removes the given object from the controller.

      Parameters

      Returns void

    • Draws all its objects as renderState says, combined with each one's own state, kept (see MeshRenderState); nothing when it is unchanged.

      Parameters

      Returns void