264 lines
12 KiB
HTML
264 lines
12 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>class osg::Vec3</TITLE>
|
|
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.3">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
|
|
<H2>class <A HREF="#DOC.DOCU">osg::Vec3</A></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>
|
|
<A HREF="#DOC.2.60.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>float <B>_v</B>[3]
|
|
<DD><I></I>
|
|
</DL></P>
|
|
|
|
<P><DL>
|
|
<DT><H3>Public Methods</H3><DD><DT>
|
|
<A HREF="#DOC.2.60.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Vec3</B>()
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Vec3</B>(float <!1><A HREF="Vec3.html#DOC.2.60.15">x</A>, float <!1><A HREF="Vec3.html#DOC.2.60.16">y</A>, float <!1><A HREF="Vec3.html#DOC.2.60.17">z</A>)
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>operator == </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& v) const
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float* <B>ptr</B>()
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline const float* <B>ptr</B>() const
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline void <B>set</B>( float <!1><A HREF="Vec3.html#DOC.2.60.15">x</A>, float <!1><A HREF="Vec3.html#DOC.2.60.16">y</A>, float <!1><A HREF="Vec3.html#DOC.2.60.17">z</A>)
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float& <B>operator [] </B>(int i)
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>operator [] </B>(int i) const
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float& <B>x</B>()
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float& <B>y</B>()
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.14"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float& <B>z</B>()
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.15"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>x</B>() const
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.16"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>y</B>() const
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.17"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>z</B>() const
|
|
<DD><I></I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.18"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>operator * </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const
|
|
<DD><I>dot product</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.19"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> <B>operator ^ </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const
|
|
<DD><I>cross product</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.20"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> <B>operator * </B>(const float& rhs) const
|
|
<DD><I>multiply by scalar</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.21"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& <B>operator *= </B>(const float& rhs)
|
|
<DD><I>unary multiply by scalar</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.22"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> <B>operator / </B>(const float& rhs) const
|
|
<DD><I>divide by scalar</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.23"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& <B>operator /= </B>(const float& rhs)
|
|
<DD><I>unary divide by scalar</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.24"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> <B>operator + </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const
|
|
<DD><I>binary vector add</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& <B>operator += </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs)
|
|
<DD><I>unary vector add.</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.25"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> <B>operator - </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const
|
|
<DD><I>binary vector subract</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.26"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& <B>operator -= </B>(const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs)
|
|
<DD><I>unary vector subract</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.27"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> <B>operator - </B>() const
|
|
<DD><I>negation operator. Returns the negative of the Vec3</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.28"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>length</B>( void ) const
|
|
<DD><I>Length of the vector = sqrt( vec . vec )</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.29"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>length2</B>( void ) const
|
|
<DD><I>Length squared of the vector = vec . vec</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>normalize</B>()
|
|
<DD><I>normalize the vector so that it has length unity returns the previous length of the vector</I>
|
|
<DT>
|
|
<A HREF="#DOC.2.60.30"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline friend ostream& <B>operator << </B>(ostream& output, const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& vec)
|
|
<DD><I></I>
|
|
</DL></P>
|
|
|
|
</DL>
|
|
|
|
<A NAME="DOC.DOCU">
|
|
<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 NAME="DOC.2.60.3">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Vec3()</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="Vec3">
|
|
<A NAME="DOC.2.60.4">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Vec3(float <!1><A HREF="Vec3.html#DOC.2.60.15">x</A>, float <!1><A HREF="Vec3.html#DOC.2.60.16">y</A>, float <!1><A HREF="Vec3.html#DOC.2.60.17">z</A>)</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="_v">
|
|
<A NAME="DOC.2.60.5">
|
|
<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 NAME="DOC.2.60.6">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool operator == (const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& v) const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="ptr">
|
|
<A NAME="DOC.2.60.7">
|
|
<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 NAME="DOC.2.60.8">
|
|
<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 NAME="DOC.2.60.9">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void set( float <!1><A HREF="Vec3.html#DOC.2.60.15">x</A>, float <!1><A HREF="Vec3.html#DOC.2.60.16">y</A>, float <!1><A HREF="Vec3.html#DOC.2.60.17">z</A>)</B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator [] ">
|
|
<A NAME="DOC.2.60.10">
|
|
<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 NAME="DOC.2.60.11">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float operator [] (int i) const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="x">
|
|
<A NAME="DOC.2.60.12">
|
|
<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 NAME="DOC.2.60.13">
|
|
<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 NAME="DOC.2.60.14">
|
|
<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 NAME="DOC.2.60.15">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float x() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="y">
|
|
<A NAME="DOC.2.60.16">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float y() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="z">
|
|
<A NAME="DOC.2.60.17">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float z() const </B></TT>
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator * ">
|
|
<A NAME="DOC.2.60.18">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float operator * (const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const </B></TT>
|
|
<DD>dot product
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator ^ ">
|
|
<A NAME="DOC.2.60.19">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> operator ^ (const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const </B></TT>
|
|
<DD>cross product
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator * ">
|
|
<A NAME="DOC.2.60.20">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> operator * (const float& rhs) const </B></TT>
|
|
<DD>multiply by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator *= ">
|
|
<A NAME="DOC.2.60.21">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& operator *= (const float& rhs)</B></TT>
|
|
<DD>unary multiply by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator / ">
|
|
<A NAME="DOC.2.60.22">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> operator / (const float& rhs) const </B></TT>
|
|
<DD>divide by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator /= ">
|
|
<A NAME="DOC.2.60.23">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& operator /= (const float& rhs)</B></TT>
|
|
<DD>unary divide by scalar
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator + ">
|
|
<A NAME="DOC.2.60.24">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> operator + (const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const </B></TT>
|
|
<DD>binary vector add
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator += ">
|
|
<A NAME="DOC.2.60.1">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& operator += (const <!1><A HREF="Vec3.html#DOC.2.60.3">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 NAME="DOC.2.60.25">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> operator - (const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs) const </B></TT>
|
|
<DD>binary vector subract
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator -= ">
|
|
<A NAME="DOC.2.60.26">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& operator -= (const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& rhs)</B></TT>
|
|
<DD>unary vector subract
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="operator - ">
|
|
<A NAME="DOC.2.60.27">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A> operator - () const </B></TT>
|
|
<DD>negation operator. Returns the negative of the Vec3
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="length">
|
|
<A NAME="DOC.2.60.28">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float length( void ) const </B></TT>
|
|
<DD>Length of the vector = sqrt( vec . vec )
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="length2">
|
|
<A NAME="DOC.2.60.29">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float length2( void ) const </B></TT>
|
|
<DD>Length squared of the vector = vec . vec
|
|
<DL><DT><DD></DL><P>
|
|
<A NAME="normalize">
|
|
<A NAME="DOC.2.60.2">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline 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>
|
|
<A NAME="operator << ">
|
|
<A NAME="DOC.2.60.30">
|
|
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline friend ostream& operator << (ostream& output, const <!1><A HREF="Vec3.html#DOC.2.60.3">Vec3</A>& vec)</B></TT>
|
|
<DL><DT><DD></DL><P></DL>
|
|
|
|
<HR><DL><DT><B>This class has no child classes.</B></DL>
|
|
|
|
<DL><DT><DD></DL><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://www.linuxsupportline.com/~doc++">DOC++</A>.
|
|
</BODY>
|