Contents

getBoundingBoxMin:max:

Gets the minimum and maximum corner points of the object’s bounding box.

Declaration

- (BOOL) getBoundingBoxMin:(SCNVector3 *) min max:(SCNVector3 *) max;

Parameters

  • min:

    On output, the minimum coordinates of the bounding box.

  • max:

    On output, the maximum coordinates of the bounding box.

Return Value

true if the object has a nonzero volume; otherwise, false.

Discussion

Scene Kit defines a bounding box in the local coordinate space using two points identifying its corners, which implicitly determine six axis-aligned planes marking its limits. For example, if a geometry’s bounding box has the minimum corner {-1, 0, 2} and the maximum corner {3, 4, 5}, all points in the geometry’s vertex data have an x-coordinate value between -1.0 and 3.0, inclusive.

The coordinates provided by this method are valid only if the object has a volume to be measured. If called on a geometry containing no vertex data or a node containing no geometry (and whose child nodes, if any, contain no geometry), this method returns NO, indicating that the values *min and *max are undefined.

See Also

Measuring an Object’s Bounding Volume