osg.BoundingSphere¶
-
class
osg.BoundingSphere¶ Represents: c++ class Wraps: osg::BoundingSphereImpl<osg::Vec3f> General purpose bounding sphere class for enclosing nodes/objects/vertices. Bounds internal
osg.Nodes in the scene, assists in view frustum culling, etc. Similar in function toosg.BoundingBox, it’s quicker for evaluating culling but generally will not cull as aggressively because it encloses a greater volume.Constructors:
-
osg.BoundingSphere()¶ 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.
Parameters: - center (
osg.Vec3) – - radius (
double) –
- center (
-
osg.BoundingSphere(osg.BoundingSphere other) Creates a bounding sphere initialized to the given extents.
Parameters: other ( osg.BoundingSphere) –
Methods:
-
:
center()¶ Returns the center of the
osg.BoundingSphere.Return type: osg.Vec3
-
:
radius()¶ Returns the radius of the
osg.BoundingSphere.Return type: double
-
:
radius2()¶ Returns the squared length of the radius. Note, for performance reasons, the calling method is responsible for checking to make sure the
osg.BoundingSphereis valid.Return type: double
-
:
contains(osg.Vec3 point)¶ Returns
trueif givenosg.Vec3is within the sphere.Parameters: point ( osg.Vec3) –Return type: bool
-
:
expandBy(osg.BoundingSphere bs)¶ Expands the
osg.BoundingSphereto encompass the givenosg.BoundingSphere. Repositions theosg.BoundingSpherecenter to minimize the radius increase. If the sphere is uninitialized, set its center and radius to match sh.Parameters: bs ( osg.BoundingSphere) –
-