OpenSceneGraph/doc/doc++/osg/BoundingSphere.html

194 lines
10 KiB
HTML
Raw Normal View History

2001-09-20 05:19:47 +08:00
<!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>
2001-09-20 05:19:47 +08:00
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>float <B><A HREF="#DOC.2.5.2">_radius</A></B>
2001-09-20 05:19:47 +08:00
</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>()
2001-09-20 05:19:47 +08:00
<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>&amp; <!1><A HREF="BoundingSphere.html#DOC.2.5.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.5.10">radius</A>)
2001-12-25 05:56:22 +08:00
<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>()
2001-09-20 05:19:47 +08:00
<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
2001-09-20 05:19:47 +08:00
<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>&amp; <!1><A HREF="BoundingSphere.html#DOC.2.5.8">center</A>, float <!1><A HREF="BoundingSphere.html#DOC.2.5.10">radius</A>)
2001-12-25 05:56:22 +08:00
<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.5.8">center</A></B>()
2001-09-20 05:19:47 +08:00
<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.5.9">center</A></B>() const
2001-09-20 05:19:47 +08:00
<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.5.10">radius</A></B>()
2001-09-20 05:19:47 +08:00
<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
2001-09-20 05:19:47 +08:00
<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
2001-09-20 05:19:47 +08:00
<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>&amp; v)
2001-12-25 05:56:22 +08:00
<DD><I>If the vertex is out-with the sphere expand to encompass vertex.</I>
2001-09-20 05:19:47 +08:00
<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>&amp; v)
2001-09-20 05:19:47 +08:00
<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>&amp; sh)
2001-09-20 05:19:47 +08:00
<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>&amp; sh)
2001-09-20 05:19:47 +08:00
<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>&amp; v) const
2001-09-20 05:19:47 +08:00
<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>&amp; bs ) const
2001-09-20 05:19:47 +08:00
<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,
2001-12-25 05:56:22 +08:00
to assist in view frustum culling etc. Similar in function to BoundingBox
2001-09-20 05:19:47 +08:00
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>
2001-09-20 05:19:47 +08:00
<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>
2001-09-20 05:19:47 +08:00
<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>
2001-09-20 05:19:47 +08:00
<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>
2001-12-25 05:56:22 +08:00
<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>&amp; <!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>
2001-12-25 05:56:22 +08:00
<DD>construct to specified bounding sphere
<DL><DT><DD></DL><P>
<A NAME="init"></A>
<A NAME="DOC.2.5.5"></A>
2001-09-20 05:19:47 +08:00
<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>
2001-09-20 05:19:47 +08:00
<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>
2001-12-25 05:56:22 +08:00
<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>&amp; <!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>
2001-12-25 05:56:22 +08:00
<DD>set bounding sphere
<DL><DT><DD></DL><P>
2001-09-20 05:19:47 +08:00
<A NAME="center"></A>
<A NAME="DOC.2.5.8"></A>
2001-09-20 05:19:47 +08:00
<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.5.9"></A>
2001-09-20 05:19:47 +08:00
<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.5.10"></A>
2001-09-20 05:19:47 +08:00
<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.5.11"></A>
2001-09-20 05:19:47 +08:00
<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>
2001-09-20 05:19:47 +08:00
<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,
2001-12-25 05:56:22 +08:00
as it does not check th validity of sphere and will erroneously return a positive value.
2001-09-20 05:19:47 +08:00
<DL><DT><DD></DL><P>
<A NAME="expandBy"></A>
<A NAME="DOC.2.5.13"></A>
2001-09-20 05:19:47 +08:00
<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>
2001-12-25 05:56:22 +08:00
<DD>If the vertex is out-with the sphere expand to encompass vertex.
2001-09-20 05:19:47 +08:00
Calculates the combination of movement of center and radius which
minimizes the radius increase. If this sphere is empty then
2001-12-25 05:56:22 +08:00
move the center to v and set radius to 0.
2001-09-20 05:19:47 +08:00
<DL><DT><DD></DL><P>
<A NAME="expandRadiusBy"></A>
<A NAME="DOC.2.5.14"></A>
2001-09-20 05:19:47 +08:00
<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.5.15"></A>
2001-09-20 05:19:47 +08:00
<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.5.16"></A>
2001-09-20 05:19:47 +08:00
<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="contains"></A>
<A NAME="DOC.2.5.17"></A>
2001-09-20 05:19:47 +08:00
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const 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.5.18"></A>
2001-09-20 05:19:47 +08:00
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const 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>