Bitbybit Docs
    Preparing search index...

    Class BabylonGizmoBoundingBoxGizmo

    The bounding box gizmo: a frame around the attached mesh with corner boxes that scale it and spheres that rotate it. The handles can keep a constant screen size, snap in steps, scale from a chosen pivot and respond with a different speed per axis.

    Index

    Constructors

    create

    get

    • Reads the size of the rotation handles of a bounding box gizmo.

      Parameters

      Returns number

      The rotation sphere size

    • Reads the size of the scale handles of a bounding box gizmo.

      Parameters

      Returns number

      The scale box size

    • Reads whether the handles of a bounding box gizmo keep a constant screen size.

      Parameters

      Returns boolean

      True when the handles keep their screen size

    • Reads whether the handles of a bounding box gizmo are sized relative to the mesh bounds.

      Parameters

      Returns boolean

      True when the handles follow the bounds

    • Reads the camera distance at which a bounding box gizmo's handles appear at their world size.

      Parameters

      Returns number

      The distance factor

    • Reads the drag step a bounding box gizmo snaps scaling to, 0 meaning smooth scaling.

      Parameters

      Returns number

      The scaling snap distance

    • Reads the angle step in radians a bounding box gizmo snaps rotation to, 0 meaning smooth rotation.

      Parameters

      Returns number

      The rotation snap distance in radians

    • Reads whether a bounding box gizmo's scale snapping steps add up rather than multiply.

      Parameters

      Returns boolean

      True when snapping is incremental

    • Reads the pivot fractions a bounding box gizmo scales around.

      Parameters

      Returns Vector3

      The pivot as fractions of the bounds

    • Reads how fast a bounding box gizmo scales the mesh for a given drag.

      Parameters

      Returns number

      The scale drag speed

    set

    • When true, the rotation spheres and scale boxes of a bounding box gizmo keep the same size on screen whatever the distance to the camera; it takes precedence over fixedDragMeshBoundsSize.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo

      bitbybit.babylon.gizmo.boundingBoxGizmo.setFixedDragMeshScreenSize({ boundingBoxGizmo, fixedDragMeshScreenSize: true });
      
    • Makes a bounding box gizmo scale the mesh in steps of scalingSnapDistance scene units of drag instead of smoothly; 0 turns snapping off.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo

    • Makes a bounding box gizmo rotate the mesh in steps of rotationSnapDistance radians instead of smoothly; 0 turns snapping off.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo

    • Chooses how a bounding box gizmo's scale snapping steps combine: incremental steps add up, 1.1 then 1.2 then 1.3 for a step of 0.1, while the default multiplies, 1.1 then 1.21 then 1.33.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo

    • Sets the point a bounding box gizmo scales the mesh around, as fractions of its bounds: [0.5, 0.5, 0.5] is the center and [0.5, 0, 0.5] the bottom; by default it scales from the opposite corner.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo

      bitbybit.babylon.gizmo.boundingBoxGizmo.setScalePivot({ boundingBoxGizmo, scalePivot: [0.5, 0, 0.5] });
      
    • Sets a separate drag sensitivity per axis for a bounding box gizmo, so scaling along one axis can respond faster or slower than the others.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo

    • Sets how fast a bounding box gizmo scales the mesh for a given drag; 1 is the default.

      Parameters

      Returns BoundingBoxGizmo

      The same bounding box gizmo