Main Content

AlignedBox

Axis-aligned bounding box

Since R2025a

    Description

    The AlignedBox object is an axis-aligned bounding box used for collision detection. It contains the dimensions of the collision box for an asset in your RoadRunner scenario.

    The AlignedBox object represents the collision box as measures in the positive and negative directions of each dimensional axis from a central point. These measures are relative to the local coordinate system of the associated asset. For example, if the AlignedBox object represents the bounding box for a vehicle asset, the dimensions of the box are relative to the vehicle and do not change as it moves and rotates in the scene. For more information on coordinate systems in RoadRunner, see Coordinate Space and Georeferencing (RoadRunner).

    Creation

    To return the AlignedBox object, extract the CollisionBox property of an asset in your scenario. For example, this code gets a VehicleAsset object, mySedan, from a RoadRunner project and extracts the AlignedBox object from its CollisionBox property:

    mySedan = getAsset(prj,"Vehicles/Sedan.fbx","VehicleAsset");
    carBox = mySedan.CollisionBox;

    Properties

    expand all

    Minimum value of the collision box that extends, in meters, in the negative direction on each axis from Center, specified as a three-element vector.

    Maximum value of the collision box that extends, in meters, in the positive direction on each axis from Center, specified as a three-element vector.

    This property is read-only.

    Center of the collision box, in meters, represented as a three-element vector.

    This property is read-only.

    Extents of the collision box, in meters, represented as a three-element vector. Extents represents the overall size of the collision box by calculating the total measure from each element of Min to its corresponding element in Max.

    Version History

    Introduced in R2025a