Class Helpers

Provides utility functions to create scene helpers, such as bounding boxes, grids, axes...

Hierarchy

  • Helpers

Constructors

Accessors

  • get axisSize(): number
  • Returns number

  • set axisSize(v): void
  • Parameters

    • v: number

    Returns void

Methods

  • Adds a bounding box helper to the object. If a bounding box is already present, it is updated instead.

    Parameters

    • obj: Object3D<Object3DEventMap>

      The object to decorate.

    • color: string | Color

      The color.

    Returns void

    Static

    Example

    // add a bounding box to 'obj'
    Helpers.addBoundingBox(obj, 'green');
  • Adds an oriented bounding box (OBB) helper to the object. If a bounding box is already present, it is updated instead.

    Parameters

    • obj: Object3D<Object3DEventMap>

      The object to decorate.

    • obb: OBB

      The OBB.

    • color: Color

      The color.

    Returns void

    Static

    Example

    // add an OBB to 'obj'
    Helpers.addOBB(obj, obj.OBB(), 'green');
  • Creates a bounding volume helper to the 3D Tile object and returns it. The bounding volume can contain a sphere, a region, or a box.

    Parameters

    • entity: Tiles3D<Material>

      The entity.

    • obj: Object3D<Object3DEventMap>

      The object to decorate.

    • metadata: ProcessedTile

      The tile metadata

    • color: string | Color

      The color.

    Returns {
        absolute: boolean;
        object3d: Object3D<Object3DEventMap>;
    }

    The helper object, or null if it could not be created.

    • absolute: boolean
    • object3d: Object3D<Object3DEventMap>

    Static

    Example

    // add a bounding box to 'obj'
    Helpers.create3DTileBoundingVolume(entity, obj, volume, 'green');
  • Creates an arrow between the two points.

    Parameters

    • start: Vector3

      The starting point.

    • end: Vector3

      The end point.

    Returns ArrowHelper

  • Create an axis helper.

    Parameters

    • size: number

      The size of the helper.

    Returns AxesHelper

    Static

  • Parameters

    • box: Box3
    • color: Color

    Returns BoundingBoxHelper

  • Create a grid on the XZ plane.

    Parameters

    • origin: Vector3

      The grid origin.

    • size: number

      The size of the grid.

    • subdivs: number

      The number of grid subdivisions.

    Returns GridHelper

    Static

  • Creates a selection bounding box helper around the specified object.

    Parameters

    • obj: Object3D<Object3DEventMap>

      The object to decorate.

    • color: Color

      The color.

    Returns BoundingBoxHelper

    the created box helper.

    Static

    Example

    // add a bounding box to 'obj'
    Helpers.createSelectionBox(obj, 'green');
  • Parameters

    • obj: Object3D<Object3DEventMap>

    Returns void

  • Removes an existing bounding box from the object, if any.

    Parameters

    • obj: Object3D<Object3DEventMap>

      The object to update.

    Returns void

    Static

    Example

    Helpers.removeBoundingBox(obj);
    
  • Parameters

    • obj: Object3D<Object3DEventMap>

    Returns void

  • Parameters

    • obj: Object3D<Object3DEventMap>
    • properties: {
          color: Color;
      }
      • color: Color

    Returns void

Generated using TypeDoc