Function fitObjectIntoVolume

  • Fits an object into a bounding volume. The volume is defined by a Box3 in world space.

    Parameters

    • obj: Object3D

      the object to fit

    • volume: Box3

      the volume to fit the object into

    • Optional opts: {
          ignore?: Object3D[];
          position?: boolean;
          scale?: boolean;
      }

      options for fitting

      • Optional ignore?: Object3D[]

        Objects to ignore when calculating the obj's bounding box

      • Optional position?: boolean

        when true aligns the objects position to the volume ground

        Default

        true
        
      • Optional scale?: boolean

        when true scales the object to fit the volume

        Default

        true
        

    Returns {
        boundsBefore: Box3;
        scale: Vector3;
    }

    • boundsBefore: Box3

      The object's bounding box before fitting

    • scale: Vector3

      The scale that was applied to the object

Generated using TypeDoc