class osg.BoundingSphere
Represents:c++ class

General purpose bounding sphere class for enclosing nodes/objects/vertices. Bounds internal osg.Node s in the scene, assists in view frustum culling, etc. Similar in function to osg.BoundingBox, it’s quicker for evaluating culling but generally will not cull as aggressively because it encloses a greater volume.



Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere.

osg.BoundingSphere(osg.Vec3 center, double radius)

Creates a bounding sphere initialized to the given extents.

  • center (osg.Vec3) –
  • radius (double) –
osg.BoundingSphere(osg.BoundingSphere other)

Creates a bounding sphere initialized to the given extents.

Параметры:other (osg.BoundingSphere) –



Returns the center of the osg.BoundingSphere.

Тип результата:osg.Vec3

Returns the radius of the osg.BoundingSphere.

Тип результата:double

Returns the squared length of the radius. Note, for performance reasons, the calling method is responsible for checking to make sure the osg.BoundingSphere is valid.

Тип результата:double
:contains(osg.Vec3 point)

Returns true if given osg.Vec3 is within the sphere.

Параметры:point (osg.Vec3) –
Тип результата:bool
:expandBy(osg.BoundingSphere bs)

Expands the osg.BoundingSphere to encompass the given osg.BoundingSphere. Repositions the osg.BoundingSphere center to minimize the radius increase. If the sphere is uninitialized, set its center and radius to match sh.

Параметры:bs (osg.BoundingSphere) –