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.
- Параметры
center (
osg.Vec3) –radius (
double) –
- osg.BoundingSphere(osg.BoundingSphere other)
Creates a bounding sphere initialized to the given extents.
- Параметры
other (
osg.BoundingSphere) –
Methods:
- :center()¶
Returns the center of the
osg.BoundingSphere.- Тип результата
- :radius()¶
Returns the radius of the
osg.BoundingSphere.- Тип результата
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.- Тип результата
double
- :contains(osg.Vec3 point)¶
Returns
trueif givenosg.Vec3is within the sphere.- Параметры
point (
osg.Vec3) –- Тип результата
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.- Параметры
bs (
osg.BoundingSphere) –