Instance Method

getBoundingSphereCenter:radius:

Gets the center point and radius of the object’s bounding sphere.

Required.

Declaration

- (BOOL)getBoundingSphereCenter:(SCNVector3 *)center radius:(CGFloat *)radius;

Parameters

center

On output, the center point of the bounding sphere.

radius

On output, the radius of the bounding sphere.

Return Value

YES if the object has a nonzero volume; otherwise, NO.

Discussion

Scene Kit defines a bounding sphere in the local coordinate space using a center point and a radius. For example, if a node’s bounding sphere has the center point {3, 1, 4} and radius 2.0, all points in the vertex data of node’s geometry (and any geometry attached to its child nodes) lie within 2.0 units of the center point.

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 *center and *radius are undefined.

See Also

Measuring an Object’s Bounding Volume

- getBoundingBoxMin:max:

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

Required.