Files
OpenSceneGraph/doc/osg/Vec2.html
2001-01-10 16:32:10 +00:00

242 lines
11 KiB
HTML

<HTML>
<HEAD>
<TITLE>class osg::Vec2</TITLE>
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.3">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>class <A HREF="#DOC.DOCU">osg::Vec2</A></H2>
<BLOCKQUOTE>General purpose float pair, uses include representation of texture coordinates.</BLOCKQUOTE>
<HR>
<DL>
<P><DL>
<DT><H3>Public Fields</H3><DD><DT>
<A HREF="#DOC.2.59.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>float <B>_v</B>[2]
<DD><I></I>
</DL></P>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<A HREF="#DOC.2.59.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Vec2</B>()
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Vec2</B>(float <!1><A HREF="Vec2.html#DOC.2.59.14">x</A>, float <!1><A HREF="Vec2.html#DOC.2.59.15">y</A>)
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>operator == </B>(const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; v) const
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float* <B>ptr</B>()
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.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.59.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline void <B>set</B>( float <!1><A HREF="Vec2.html#DOC.2.59.14">x</A>, float <!1><A HREF="Vec2.html#DOC.2.59.15">y</A> )
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float&amp; <B>operator [] </B>(int i)
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.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.59.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float&amp; <B>x</B>()
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float&amp; <B>y</B>()
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.14"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>x</B>() const
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.15"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>y</B>() const
<DD><I></I>
<DT>
<A HREF="#DOC.2.59.16"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>operator * </B>(const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs) const
<DD><I>dot product</I>
<DT>
<A HREF="#DOC.2.59.17"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> <B>operator * </B>(const float&amp; rhs) const
<DD><I>multiply by scalar</I>
<DT>
<A HREF="#DOC.2.59.18"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; <B>operator *= </B>(const float&amp; rhs)
<DD><I>unary multiply by scalar</I>
<DT>
<A HREF="#DOC.2.59.19"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> <B>operator / </B>(const float&amp; rhs) const
<DD><I>divide by scalar</I>
<DT>
<A HREF="#DOC.2.59.20"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; <B>operator /= </B>(const float&amp; rhs)
<DD><I>unary divide by scalar</I>
<DT>
<A HREF="#DOC.2.59.21"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> <B>operator + </B>(const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs) const
<DD><I>binary vector add</I>
<DT>
<A HREF="#DOC.2.59.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; <B>operator += </B>(const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs)
<DD><I>unary vector add.</I>
<DT>
<A HREF="#DOC.2.59.22"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> <B>operator - </B>(const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs) const
<DD><I>binary vector subract</I>
<DT>
<A HREF="#DOC.2.59.23"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; <B>operator -= </B>(const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs)
<DD><I>unary vector subract</I>
<DT>
<A HREF="#DOC.2.59.24"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> <B>operator - </B>() const
<DD><I>negation operator. Returns the negative of the Vec2</I>
<DT>
<A HREF="#DOC.2.59.25"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline float <B>length</B>() const
<DD><I>Length of the vector = sqrt( vec . vec )</I>
<DT>
<A HREF="#DOC.2.59.26"><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.59.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.59.27"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>inline friend ostream&amp; <B>operator << </B>(ostream&amp; output, const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; vec)
<DD><I></I>
</DL></P>
</DL>
<A NAME="DOC.DOCU">
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>General purpose float pair, uses include representation of
texture coordinates.
No support yet added for float * Vec2 - is it necessary?
Need to define a non-member non-friend operator* etc.
BTW: Vec2 * float is okay</BLOCKQUOTE>
<DL>
<A NAME="Vec2">
<A NAME="DOC.2.59.3">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Vec2()</B></TT>
<DL><DT><DD></DL><P>
<A NAME="Vec2">
<A NAME="DOC.2.59.4">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Vec2(float <!1><A HREF="Vec2.html#DOC.2.59.14">x</A>, float <!1><A HREF="Vec2.html#DOC.2.59.15">y</A>)</B></TT>
<DL><DT><DD></DL><P>
<A NAME="_v">
<A NAME="DOC.2.59.5">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>float _v[2]</B></TT>
<DL><DT><DD></DL><P>
<A NAME="operator == ">
<A NAME="DOC.2.59.6">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool operator == (const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; v) const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="ptr">
<A NAME="DOC.2.59.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.59.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.59.9">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void set( float <!1><A HREF="Vec2.html#DOC.2.59.14">x</A>, float <!1><A HREF="Vec2.html#DOC.2.59.15">y</A> )</B></TT>
<DL><DT><DD></DL><P>
<A NAME="operator [] ">
<A NAME="DOC.2.59.10">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float&amp; operator [] (int i)</B></TT>
<DL><DT><DD></DL><P>
<A NAME="operator [] ">
<A NAME="DOC.2.59.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.59.12">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float&amp; x()</B></TT>
<DL><DT><DD></DL><P>
<A NAME="y">
<A NAME="DOC.2.59.13">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float&amp; y()</B></TT>
<DL><DT><DD></DL><P>
<A NAME="x">
<A NAME="DOC.2.59.14">
<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.59.15">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float y() const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="operator * ">
<A NAME="DOC.2.59.16">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float operator * (const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs) const </B></TT>
<DD>dot product
<DL><DT><DD></DL><P>
<A NAME="operator * ">
<A NAME="DOC.2.59.17">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> operator * (const float&amp; rhs) const </B></TT>
<DD>multiply by scalar
<DL><DT><DD></DL><P>
<A NAME="operator *= ">
<A NAME="DOC.2.59.18">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; operator *= (const float&amp; rhs)</B></TT>
<DD>unary multiply by scalar
<DL><DT><DD></DL><P>
<A NAME="operator / ">
<A NAME="DOC.2.59.19">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> operator / (const float&amp; rhs) const </B></TT>
<DD>divide by scalar
<DL><DT><DD></DL><P>
<A NAME="operator /= ">
<A NAME="DOC.2.59.20">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; operator /= (const float&amp; rhs)</B></TT>
<DD>unary divide by scalar
<DL><DT><DD></DL><P>
<A NAME="operator + ">
<A NAME="DOC.2.59.21">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> operator + (const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs) const </B></TT>
<DD>binary vector add
<DL><DT><DD></DL><P>
<A NAME="operator += ">
<A NAME="DOC.2.59.1">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; operator += (const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; 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.59.22">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> operator - (const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs) const </B></TT>
<DD>binary vector subract
<DL><DT><DD></DL><P>
<A NAME="operator -= ">
<A NAME="DOC.2.59.23">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; operator -= (const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; rhs)</B></TT>
<DD>unary vector subract
<DL><DT><DD></DL><P>
<A NAME="operator - ">
<A NAME="DOC.2.59.24">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A> operator - () const </B></TT>
<DD>negation operator. Returns the negative of the Vec2
<DL><DT><DD></DL><P>
<A NAME="length">
<A NAME="DOC.2.59.25">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float length() const </B></TT>
<DD>Length of the vector = sqrt( vec . vec )
<DL><DT><DD></DL><P>
<A NAME="length2">
<A NAME="DOC.2.59.26">
<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.59.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.59.27">
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline friend ostream&amp; operator << (ostream&amp; output, const <!1><A HREF="Vec2.html#DOC.2.59.3">Vec2</A>&amp; 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>