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

Constructors

Accessors

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

    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

    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, EntityUserData>

      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>

    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

  • 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

  • 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.

    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

    Example

    Helpers.removeBoundingBox(obj);
    
  • Parameters

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

    Returns void