250 lines
12 KiB
HTML
250 lines
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>class osg::Vec3</TITLE>
|
|
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.8">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
|
|
<H2>class <A HREF="#DOC.DOCU">osg::Vec3</A></H2></H2><BLOCKQUOTE>General purpose float triple for use as vertices, vectors and normals.</BLOCKQUOTE>
|
|
<HR>
|
|
|
|
<DL>
|
|
<P><DL>
|
|
<DT><H3>Public Fields</H3><DD><DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>float <B><A HREF="#DOC.2.106.3">_v</A></B>[3]
|
|
</DL></P>
|
|
|
|
<P><DL>
|
|
<DT><H3>Public Methods</H3><DD><DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.106.1">Vec3</A></B>()
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.106.2">Vec3</A></B>(float <!1><A HREF="Vec3.html#DOC.2.106.11">x</A>, float <!1><A HREF="Vec3.html#DOC.2.106.12">y</A>, float <!1><A HREF="Vec3.html#DOC.2.106.13">z</A>)
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const bool <B><A HREF="#DOC.2.106.4">operator == </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& v) const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const bool <B><A HREF="#DOC.2.106.5">operator < </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& v) const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float* <B><A HREF="#DOC.2.106.6">ptr</A></B>()
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float* <B><A HREF="#DOC.2.106.7">ptr</A></B>() const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline void <B><A HREF="#DOC.2.106.8">set</A></B>( float <!1><A HREF="Vec3.html#DOC.2.106.11">x</A>, float <!1><A HREF="Vec3.html#DOC.2.106.12">y</A>, float <!1><A HREF="Vec3.html#DOC.2.106.13">z</A>)
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float& <B><A HREF="#DOC.2.106.9">operator [] </A></B>(int i)
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.10">operator [] </A></B>(int i) const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float& <B><A HREF="#DOC.2.106.11">x</A></B>()
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float& <B><A HREF="#DOC.2.106.12">y</A></B>()
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float& <B><A HREF="#DOC.2.106.13">z</A></B>()
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.14">x</A></B>() const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.15">y</A></B>() const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.16">z</A></B>() const
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float <B><A HREF="#DOC.2.106.17">operator * </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const
|
|
<DD><I>dot product</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.106.18">operator ^ </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const
|
|
<DD><I>cross product</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.106.19">operator * </A></B>(const float& rhs) const
|
|
<DD><I>multiply by scalar</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline <!1><A HREF="Vec3.html">Vec3</A>& <B><A HREF="#DOC.2.106.20">operator *= </A></B>(const float& rhs)
|
|
<DD><I>unary multiply by scalar</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.106.21">operator / </A></B>(const float& rhs) const
|
|
<DD><I>divide by scalar</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline <!1><A HREF="Vec3.html">Vec3</A>& <B><A HREF="#DOC.2.106.22">operator /= </A></B>(const float& rhs)
|
|
<DD><I>unary divide by scalar</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.106.23">operator + </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const
|
|
<DD><I>binary vector add</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline <!1><A HREF="Vec3.html">Vec3</A>& <B><A HREF="#DOC.2.106.24">operator += </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& rhs)
|
|
<DD><I>unary vector add.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.106.25">operator - </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const
|
|
<DD><I>binary vector subract</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline <!1><A HREF="Vec3.html">Vec3</A>& <B><A HREF="#DOC.2.106.26">operator -= </A></B>(const <!1><A HREF="Vec3.html">Vec3</A>& rhs)
|
|
<DD><I>unary vector subract</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="Vec3.html">Vec3</A> <B><A HREF="#DOC.2.106.27">operator - </A></B>() const
|
|
<DD><I>negation operator.</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.28">length</A></B>() const
|
|
<DD><I>Length of the vector = sqrt( vec .</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.29">length2</A></B>() const
|
|
<DD><I>Length squared of the vector = vec .</I>
|
|
<DT>
|
|
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const float <B><A HREF="#DOC.2.106.30">normalize</A></B>()
|
|
<DD><I>normalize the vector so that it has length unity returns the previous length of the vector</I>
|
|
</DL></P>
|
|
|
|
</DL>
|
|
|
|
<A NAME="DOC.DOCU"></A>
|
|
<HR>
|
|
<H2>Documentation</H2>
|
|
<BLOCKQUOTE>General purpose float triple for use as vertices, vectors and normals.
|
|
Provides general maths operations from addition through to cross products.
|
|
No support yet added for float * Vec3 - is it necessary?
|
|
Need to define a non-member non-friend operator* etc.
|
|
Vec3 * float is okay</BLOCKQUOTE>
|
|
<DL>
|
|
|
|
<A NAME="Vec3"></A>
|
|
<A NAME="DOC.2.106.1"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Vec3()</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="Vec3"></A>
|
|
<A NAME="DOC.2.106.2"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Vec3(float <!1><A HREF="Vec3.html#DOC.2.106.11">x</A>, float <!1><A HREF="Vec3.html#DOC.2.106.12">y</A>, float <!1><A HREF="Vec3.html#DOC.2.106.13">z</A>)</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="_v"></A>
|
|
<A NAME="DOC.2.106.3"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>float _v[3]</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator == "></A>
|
|
<A NAME="DOC.2.106.4"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const bool operator == (const <!1><A HREF="Vec3.html">Vec3</A>& v) const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator < "></A>
|
|
<A NAME="DOC.2.106.5"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const bool operator < (const <!1><A HREF="Vec3.html">Vec3</A>& v) const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="ptr"></A>
|
|
<A NAME="DOC.2.106.6"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float* ptr()</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="ptr"></A>
|
|
<A NAME="DOC.2.106.7"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float* ptr() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="set"></A>
|
|
<A NAME="DOC.2.106.8"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void set( float <!1><A HREF="Vec3.html#DOC.2.106.11">x</A>, float <!1><A HREF="Vec3.html#DOC.2.106.12">y</A>, float <!1><A HREF="Vec3.html#DOC.2.106.13">z</A>)</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator [] "></A>
|
|
<A NAME="DOC.2.106.9"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float& operator [] (int i)</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator [] "></A>
|
|
<A NAME="DOC.2.106.10"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float operator [] (int i) const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="x"></A>
|
|
<A NAME="DOC.2.106.11"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float& x()</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="y"></A>
|
|
<A NAME="DOC.2.106.12"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float& y()</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="z"></A>
|
|
<A NAME="DOC.2.106.13"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float& z()</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="x"></A>
|
|
<A NAME="DOC.2.106.14"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float x() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="y"></A>
|
|
<A NAME="DOC.2.106.15"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float y() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="z"></A>
|
|
<A NAME="DOC.2.106.16"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float z() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator * "></A>
|
|
<A NAME="DOC.2.106.17"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float operator * (const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const </B></TT>
|
|
<DD>dot product
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator ^ "></A>
|
|
<A NAME="DOC.2.106.18"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A> operator ^ (const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const </B></TT>
|
|
<DD>cross product
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator * "></A>
|
|
<A NAME="DOC.2.106.19"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A> operator * (const float& rhs) const </B></TT>
|
|
<DD>multiply by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator *= "></A>
|
|
<A NAME="DOC.2.106.20"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html">Vec3</A>& operator *= (const float& rhs)</B></TT>
|
|
<DD>unary multiply by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator / "></A>
|
|
<A NAME="DOC.2.106.21"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A> operator / (const float& rhs) const </B></TT>
|
|
<DD>divide by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator /= "></A>
|
|
<A NAME="DOC.2.106.22"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html">Vec3</A>& operator /= (const float& rhs)</B></TT>
|
|
<DD>unary divide by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator + "></A>
|
|
<A NAME="DOC.2.106.23"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A> operator + (const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const </B></TT>
|
|
<DD>binary vector add
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator += "></A>
|
|
<A NAME="DOC.2.106.24"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html">Vec3</A>& operator += (const <!1><A HREF="Vec3.html">Vec3</A>& rhs)</B></TT>
|
|
<DD>unary vector add. Slightly more efficient because no temporary
|
|
intermediate object
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator - "></A>
|
|
<A NAME="DOC.2.106.25"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A> operator - (const <!1><A HREF="Vec3.html">Vec3</A>& rhs) const </B></TT>
|
|
<DD>binary vector subract
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator -= "></A>
|
|
<A NAME="DOC.2.106.26"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html">Vec3</A>& operator -= (const <!1><A HREF="Vec3.html">Vec3</A>& rhs)</B></TT>
|
|
<DD>unary vector subract
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator - "></A>
|
|
<A NAME="DOC.2.106.27"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="Vec3.html">Vec3</A> operator - () const </B></TT>
|
|
<DD>negation operator. Returns the negative of the Vec3
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="length"></A>
|
|
<A NAME="DOC.2.106.28"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float length() const </B></TT>
|
|
<DD>Length of the vector = sqrt( vec . vec )
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="length2"></A>
|
|
<A NAME="DOC.2.106.29"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float length2() const </B></TT>
|
|
<DD>Length squared of the vector = vec . vec
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="normalize"></A>
|
|
<A NAME="DOC.2.106.30"></A>
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const float normalize()</B></TT>
|
|
<DD>normalize the vector so that it has length unity
|
|
returns the previous length of the vector
|
|
<DL><DT><DD></DL><P></DL>
|
|
|
|
<HR><DL><DT><B>This class has no child classes.</B></DL>
|
|
|
|
<DL><DT><DT><B>Friends:</B><DD> inline ostream& operator << (ostream& output, const <!1><A HREF="Vec3.html">Vec3</A>& vec)<BR><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>
|