OpenSceneGraph/doc/doc++/osg/BoundingSphere.html
2003-07-23 11:27:31 +00:00

215 lines
11 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.10">
</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.30.1">_center</A></B>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>float <B><A HREF="#DOC.2.30.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.30.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.30.4">BoundingSphere</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>&amp; <!1><A HREF="BoundingSphere.html#DOC.2.30.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.30.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.30.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 bool <B><A HREF="#DOC.2.30.6">valid</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.30.7">set</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>&amp; <!1><A HREF="BoundingSphere.html#DOC.2.30.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.30.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>&amp; <B><A HREF="#DOC.2.30.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>&amp; <B><A HREF="#DOC.2.30.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&amp; <B><A HREF="#DOC.2.30.10">radius</A></B>()
<DD><I>return the radius of the bounding sphere</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float <B><A HREF="#DOC.2.30.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 float <B><A HREF="#DOC.2.30.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.30.13">expandBy</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>&amp; 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.30.14">expandRadiusBy</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>&amp; 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.30.15">expandBy</A></B>(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>&amp; 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.30.16">expandRadiusBy</A></B>(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>&amp; 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>void <B><A HREF="#DOC.2.30.17">expandBy</A></B>(const <!1><A HREF="BoundingBox.html">BoundingBox</A>&amp; bb)
<DD><I>If incomming box is outwith the sphere expand to ecompass incomming box.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.2.30.18">expandRadiusBy</A></B>(const <!1><A HREF="BoundingBox.html">BoundingBox</A>&amp; bb)
<DD><I>If incomming box is outwith the sphere expand radius to ecompass incomming box.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline bool <B><A HREF="#DOC.2.30.19">contains</A></B>(const <!1><A HREF="Vec3.html">Vec3</A>&amp; v) const
<DD><I>return true is vertex v is within the sphere</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline bool <B><A HREF="#DOC.2.30.20">intersects</A></B>( const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>&amp; 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.30.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.30.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.30.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.30.4"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> BoundingSphere(const <!1><A HREF="Vec3.html">Vec3</A>&amp; <!1><A HREF="BoundingSphere.html#DOC.2.30.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.30.10">radius</A>)</B></TT>
<DD>construct to specified bounding sphere
<DL><DT><DD></DL><P>
<A NAME="init"></A>
<A NAME="DOC.2.30.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="valid"></A>
<A NAME="DOC.2.30.6"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline bool valid() 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.30.7"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void set(const <!1><A HREF="Vec3.html">Vec3</A>&amp; <!1><A HREF="BoundingSphere.html#DOC.2.30.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.30.10">radius</A>)</B></TT>
<DD>set bounding sphere
<DL><DT><DD></DL><P>
<A NAME="center"></A>
<A NAME="DOC.2.30.8"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html">Vec3</A>&amp; center()</B></TT>
<DD>return the center of the bounding sphere
<DL><DT><DD></DL><P>
<A NAME="center"></A>
<A NAME="DOC.2.30.9"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A>&amp; 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.30.10"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float&amp; radius()</B></TT>
<DD>return the radius of the bounding sphere
<DL><DT><DD></DL><P>
<A NAME="radius"></A>
<A NAME="DOC.2.30.11"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline 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.30.12"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline 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.30.13"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandBy(const <!1><A HREF="Vec3.html">Vec3</A>&amp; 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.30.14"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandRadiusBy(const <!1><A HREF="Vec3.html">Vec3</A>&amp; 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.30.15"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandBy(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>&amp; 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.30.16"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandRadiusBy(const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>&amp; 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="expandBy"></A>
<A NAME="DOC.2.30.17"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandBy(const <!1><A HREF="BoundingBox.html">BoundingBox</A>&amp; bb)</B></TT>
<DD>If incomming box is outwith the sphere expand to ecompass incomming box.
calculates the combination of movement of center and radius which
minimizes the radius increase. If this boz 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.30.18"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void expandRadiusBy(const <!1><A HREF="BoundingBox.html">BoundingBox</A>&amp; bb)</B></TT>
<DD>If incomming box is outwith the sphere expand radius to ecompass incomming box.
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.30.19"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline bool contains(const <!1><A HREF="Vec3.html">Vec3</A>&amp; 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.30.20"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline bool intersects( const <!1><A HREF="BoundingSphere.html">BoundingSphere</A>&amp; 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>