194 lines
10 KiB
HTML
194 lines
10 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>class SG_EXPORT osg::BoundingSphere</TITLE>
|
|
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.8">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
|
|
<H2>class SG_EXPORT <A HREF="#DOC.DOCU">osg::BoundingSphere</A></H2></H2><BLOCKQUOTE>General purpose bounding sphere class for enclosing nodes/objects/vertices.</BLOCKQUOTE>
|
|
<HR>
|
|
|
|
<DL>
|
|
<P><DL>
|
|
<DT><H3>Public Fields</H3><DD><DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif><!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.5.1">_center</A></B>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>float <B><A HREF="#DOC.2.5.2">_radius</A></B>
|
|
</DL></P>
|
|
|
|
<P><DL>
|
|
<DT><H3>Public Methods</H3><DD><DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.5.3">BoundingSphere</A></B>()
|
|
<DD><I>construct to invalid values to represent an unset bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.5.4">BoundingSphere</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& <!1><A HREF="BoundingSphere.html#DOC.2.5.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.5.10">radius</A>)
|
|
<DD><I>construct to specified bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline void <B><A HREF="#DOC.2.5.5">init</A></B>()
|
|
<DD><I>initialize to invalid values to represent an unset bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const bool <B><A HREF="#DOC.2.5.6">isValid</A></B>() const
|
|
<DD><I>return true if the bounding sphere contains valid values, false if the bounding sphere is effectively unset</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline void <B><A HREF="#DOC.2.5.7">set</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& <!1><A HREF="BoundingSphere.html#DOC.2.5.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.5.10">radius</A>)
|
|
<DD><I>set bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline <!1><A HREF="Vec3.html">Vec3</A>& <B><A HREF="#DOC.2.5.8">center</A></B>()
|
|
<DD><I>return the center of the bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A>& <B><A HREF="#DOC.2.5.9">center</A></B>() const
|
|
<DD><I>return the const center of the bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float& <B><A HREF="#DOC.2.5.10">radius</A></B>()
|
|
<DD><I>return the radius of the bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.5.11">radius</A></B>() const
|
|
<DD><I>return the const radius of the bounding sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.5.12">radius2</A></B>() const
|
|
<DD><I>return the radius squared.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.2.5.13">expandBy</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& v)
|
|
<DD><I>If the vertex is out-with the sphere expand to encompass vertex.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.2.5.14">expandRadiusBy</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& v)
|
|
<DD><I>If the vertex is outwith the sphere expand radius to ecompass vertex.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.2.5.15">expandBy</A></B>(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>& sh)
|
|
<DD><I>If incomming sphere is outwith the sphere expand to ecompass incomming sphere.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.2.5.16">expandRadiusBy</A></B>(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>& sh)
|
|
<DD><I>If incomming sphere is outwith the sphere expand radius to ecompass incomming sphere.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const bool <B><A HREF="#DOC.2.5.17">contains</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& v) const
|
|
<DD><I>return true is vertex v is within the sphere</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const bool <B><A HREF="#DOC.2.5.18">intersects</A></B>( const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>& bs ) const
|
|
<DD><I>return true if bounding sphere's intersect each other</I>
|
|
</DL></P>
|
|
|
|
</DL>
|
|
|
|
<A NAME="DOC.DOCU"></A>
|
|
<HR>
|
|
<H2>Documentation</H2>
|
|
<BLOCKQUOTE>General purpose bounding sphere class for enclosing nodes/objects/vertices.
|
|
Used to bound internal osg::Node's in the scene,
|
|
to assist in view frustum culling etc. Similar in function to BoundingBox
|
|
but is quicker for evaluating culling, but generally encloses a greater volume
|
|
than a BoundingBox so will not cull so aggressively.</BLOCKQUOTE>
|
|
<DL>
|
|
|
|
<A NAME="_center"></A>
|
|
<A NAME="DOC.2.5.1"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="Vec3.html">Vec3</A> _center</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="_radius"></A>
|
|
<A NAME="DOC.2.5.2"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>float _radius</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="BoundingSphere"></A>
|
|
<A NAME="DOC.2.5.3"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> BoundingSphere()</B></TT>
|
|
<DD>construct to invalid values to represent an unset bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="BoundingSphere"></A>
|
|
<A NAME="DOC.2.5.4"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> BoundingSphere(const <!1><A HREF="Vec3.html">Vec3</A>& <!1><A HREF="BoundingSphere.html#DOC.2.5.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.5.10">radius</A>)</B></TT>
|
|
<DD>construct to specified bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="init"></A>
|
|
<A NAME="DOC.2.5.5"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void init()</B></TT>
|
|
<DD>initialize to invalid values to represent an unset bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="isValid"></A>
|
|
<A NAME="DOC.2.5.6"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const bool isValid() const </B></TT>
|
|
<DD>return true if the bounding sphere contains valid values,
|
|
false if the bounding sphere is effectively unset
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="set"></A>
|
|
<A NAME="DOC.2.5.7"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void set(const <!1><A HREF="Vec3.html">Vec3</A>& <!1><A HREF="BoundingSphere.html#DOC.2.5.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.5.10">radius</A>)</B></TT>
|
|
<DD>set bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="center"></A>
|
|
<A NAME="DOC.2.5.8"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html">Vec3</A>& center()</B></TT>
|
|
<DD>return the center of the bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="center"></A>
|
|
<A NAME="DOC.2.5.9"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A>& center() const </B></TT>
|
|
<DD>return the const center of the bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="radius"></A>
|
|
<A NAME="DOC.2.5.10"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float& radius()</B></TT>
|
|
<DD>return the radius of the bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="radius"></A>
|
|
<A NAME="DOC.2.5.11"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float radius() const </B></TT>
|
|
<DD>return the const radius of the bounding sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="radius2"></A>
|
|
<A NAME="DOC.2.5.12"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float radius2() const </B></TT>
|
|
<DD>return the radius squared.
|
|
Note, for performance reasons, assumes the calling method has ensured
|
|
that the sphere is valid before calling radius2(), i.e. has _radius>=0.0,
|
|
as it does not check th validity of sphere and will erroneously return a positive value.
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="expandBy"></A>
|
|
<A NAME="DOC.2.5.13"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandBy(const <!1><A HREF="Vec3.html">Vec3</A>& v)</B></TT>
|
|
<DD>If the vertex is out-with the sphere expand to encompass vertex.
|
|
Calculates the combination of movement of center and radius which
|
|
minimizes the radius increase. If this sphere is empty then
|
|
move the center to v and set radius to 0.
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="expandRadiusBy"></A>
|
|
<A NAME="DOC.2.5.14"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandRadiusBy(const <!1><A HREF="Vec3.html">Vec3</A>& v)</B></TT>
|
|
<DD>If the vertex is outwith the sphere expand radius to ecompass vertex.
|
|
Unlike update, does not move the center, just increasing the radius.
|
|
If this sphere is empty then move the centrer to v and set radius to 0
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="expandBy"></A>
|
|
<A NAME="DOC.2.5.15"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandBy(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>& sh)</B></TT>
|
|
<DD>If incomming sphere is outwith the sphere expand to ecompass incomming sphere.
|
|
calculates the combination of movement of center and radius which
|
|
minimizes the radius increase. If this sphere is empty then
|
|
move the centrer to v and set radius to 0.
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="expandRadiusBy"></A>
|
|
<A NAME="DOC.2.5.16"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandRadiusBy(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>& sh)</B></TT>
|
|
<DD>If incomming sphere is outwith the sphere expand radius to ecompass incomming sphere.
|
|
Unlike update, does not move the center, just increasing the radius.
|
|
If this sphere is empty then move the centrer to v and set radius to 0.
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="contains"></A>
|
|
<A NAME="DOC.2.5.17"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const bool contains(const <!1><A HREF="Vec3.html">Vec3</A>& v) const </B></TT>
|
|
<DD>return true is vertex v is within the sphere
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="intersects"></A>
|
|
<A NAME="DOC.2.5.18"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const bool intersects( const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>& bs ) const </B></TT>
|
|
<DD>return true if bounding sphere's intersect each other
|
|
<DL><DT><DD></DL><P></DL>
|
|
|
|
<HR><DL><DT><B>This class has no child classes.</B></DL>
|
|
|
|
<DL><DT><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR>
|
|
<BR>
|
|
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
|
|
</BODY>
|
|
</HTML>
|