source: OGRE/trunk/ogrenew/Docs/api/html/OgreVector4_8h-source.html @ 692

Revision 692, 31.3 KB checked in by mattausch, 18 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1<html>
2<head>
3<title>OgreVector4.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
4<link type="text/css" rel="stylesheet" href="style.css">
5</head>
6
7<body>
8<!-- Generated by Doxygen 1.3.6 -->
9<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
10<h1>OgreVector4.h</h1><a href="OgreVector4_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
1100002 <span class="comment">-----------------------------------------------------------------------------</span>
1200003 <span class="comment">This source file is part of OGRE</span>
1300004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
1400005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
1500006 <span class="comment"></span>
1600007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
1700008 <span class="comment">Also see acknowledgements in Readme.html</span>
1800009 <span class="comment"></span>
1900010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
2000011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
2100012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
2200013 <span class="comment">version.</span>
2300014 <span class="comment"></span>
2400015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
2500016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
2600017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
2700018 <span class="comment"></span>
2800019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
2900020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
3000021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
3100022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
3200023 <span class="comment">-----------------------------------------------------------------------------</span>
3300024 <span class="comment">*/</span>
3400025 <span class="preprocessor">#ifndef __Vector4_H__</span>
3500026 <span class="preprocessor"></span><span class="preprocessor">#define __Vector4_H__</span>
3600027 <span class="preprocessor"></span>
3700028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span>
3800029 <span class="preprocessor">#include "<a class="code" href="OgreVector3_8h.html">OgreVector3.h</a>"</span>
3900030
4000031 <span class="keyword">namespace </span>Ogre
4100032 {
4200033
43<a name="l00036"></a><a class="code" href="classOgre_1_1Vector4.html">00036</a>     <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> Vector4
4400037     {
4500038     <span class="keyword">public</span>:
4600039         <span class="keyword">union </span>{
4700040             <span class="keyword">struct </span>{
48<a name="l00041"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">00041</a>                 <a class="code" href="namespaceOgre.html#a465">Real</a> x, y, z, w;
4900042             };
50<a name="l00043"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o4">00043</a>             <a class="code" href="namespaceOgre.html#a465">Real</a> val[4];
5100044         };
5200045
5300046     <span class="keyword">public</span>:
54<a name="l00047"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a0">00047</a>         <span class="keyword">inline</span> Vector4()
5500048         {
5600049         }
5700050
58<a name="l00051"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a1">00051</a>         <span class="keyword">inline</span> Vector4( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fX, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fY, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fZ, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fW )
5900052             : x( fX ), y( fY ), z( fZ ), w( fW)
6000053         {
6100054         }
6200055
63<a name="l00056"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a2">00056</a>         <span class="keyword">inline</span> <span class="keyword">explicit</span> Vector4( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> afCoordinate[4] )
6400057             : x( afCoordinate[0] ),
6500058               y( afCoordinate[1] ),
6600059               z( afCoordinate[2] ),
6700060               w( afCoordinate[3] )
6800061         {
6900062         }
7000063
71<a name="l00064"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a3">00064</a>         <span class="keyword">inline</span> <span class="keyword">explicit</span> Vector4( <span class="keyword">const</span> <span class="keywordtype">int</span> afCoordinate[4] )
7200065         {
7300066             x = (<a class="code" href="namespaceOgre.html#a465">Real</a>)afCoordinate[0];
7400067             y = (<a class="code" href="namespaceOgre.html#a465">Real</a>)afCoordinate[1];
7500068             z = (<a class="code" href="namespaceOgre.html#a465">Real</a>)afCoordinate[2];
7600069             w = (<a class="code" href="namespaceOgre.html#a465">Real</a>)afCoordinate[3];
7700070         }
7800071
79<a name="l00072"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a4">00072</a>         <span class="keyword">inline</span> <span class="keyword">explicit</span> Vector4( <a class="code" href="namespaceOgre.html#a465">Real</a>* <span class="keyword">const</span> r )
8000073             : x( r[0] ), y( r[1] ), z( r[2] ), w( r[3] )
8100074         {
8200075         }
8300076
84<a name="l00077"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a5">00077</a>         <span class="keyword">inline</span> <span class="keyword">explicit</span> Vector4( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> scaler )
8500078             : x( scaler )
8600079             , y( scaler )
8700080             , z( scaler )
8800081             , w( scaler )
8900082         {
9000083         }
9100084
92<a name="l00085"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a6">00085</a>         <span class="keyword">inline</span> Vector4( <span class="keyword">const</span> Vector4&amp; rkVector )
9300086             : x( rkVector.x ), y( rkVector.y ), z( rkVector.z ), w (rkVector.w)
9400087         {
9500088         }
9600089
97<a name="l00090"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a7">00090</a>         <span class="keyword">inline</span> <a class="code" href="namespaceOgre.html#a465">Real</a> operator [] ( <span class="keyword">const</span> size_t i )<span class="keyword"> const</span>
9800091 <span class="keyword">        </span>{
9900092             assert( i &lt; 4 );
10000093
10100094             <span class="keywordflow">return</span> *(&amp;x+i);
10200095         }
10300096
104<a name="l00097"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a8">00097</a>         <span class="keyword">inline</span> <a class="code" href="namespaceOgre.html#a465">Real</a>&amp; operator [] ( <span class="keyword">const</span> size_t i )
10500098         {
10600099             assert( i &lt; 4 );
10700100
10800101             <span class="keywordflow">return</span> *(&amp;x+i);
10900102         }
11000103
111<a name="l00108"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a9">00108</a>         <span class="keyword">inline</span> Vector4&amp; operator = ( <span class="keyword">const</span> Vector4&amp; rkVector )
11200109         {
11300110             x = rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
11400111             y = rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
11500112             z = rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
11600113             w = rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
11700114
11800115             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
11900116         }
12000117
121<a name="l00118"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a10">00118</a>         <span class="keyword">inline</span> Vector4&amp; operator = ( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar)
12200119         {
12300120             x = fScalar;
12400121             y = fScalar;
12500122             z = fScalar;
12600123             w = fScalar;
12700124             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
12800125         }
12900126
130<a name="l00127"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a11">00127</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceOgre.html#a623">operator == </a>( <span class="keyword">const</span> Vector4&amp; rkVector )<span class="keyword"> const</span>
13100128 <span class="keyword">        </span>{
13200129             <span class="keywordflow">return</span> ( x == rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> &amp;&amp;
13300130                 y == rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> &amp;&amp;
13400131                 z == rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> &amp;&amp;
13500132                 w == rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> );
13600133         }
13700134
138<a name="l00135"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a12">00135</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceOgre.html#a624">operator != </a>( <span class="keyword">const</span> Vector4&amp; rkVector )<span class="keyword"> const</span>
13900136 <span class="keyword">        </span>{
14000137             <span class="keywordflow">return</span> ( x != rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> ||
14100138                 y != rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> ||
14200139                 z != rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> ||
14300140                 w != rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> );
14400141         }
14500142
146<a name="l00143"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a13">00143</a>         <span class="keyword">inline</span> Vector4&amp; operator = (<span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>&amp; rhs)
14700144         {
14800145             x = rhs.<a class="code" href="classOgre_1_1Vector3.html#Ogre_1_1Vector3o0">x</a>;
14900146             y = rhs.<a class="code" href="classOgre_1_1Vector3.html#Ogre_1_1Vector3o1">y</a>;
15000147             z = rhs.<a class="code" href="classOgre_1_1Vector3.html#Ogre_1_1Vector3o2">z</a>;
15100148             w = 1.0f;
15200149             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
15300150         }
15400151
15500152         <span class="comment">// arithmetic operations</span>
156<a name="l00153"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a14">00153</a>         <span class="keyword">inline</span> Vector4 operator + ( <span class="keyword">const</span> Vector4&amp; rkVector )<span class="keyword"> const</span>
15700154 <span class="keyword">        </span>{
15800155             Vector4 kSum;
15900156
16000157             kSum.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = x + rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
16100158             kSum.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = y + rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
16200159             kSum.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = z + rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
16300160             kSum.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = w + rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
16400161
16500162             <span class="keywordflow">return</span> kSum;
16600163         }
16700164
168<a name="l00165"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a15">00165</a>         <span class="keyword">inline</span> Vector4 operator - ( <span class="keyword">const</span> Vector4&amp; rkVector )<span class="keyword"> const</span>
16900166 <span class="keyword">        </span>{
17000167             Vector4 kDiff;
17100168
17200169             kDiff.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = x - rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
17300170             kDiff.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = y - rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
17400171             kDiff.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = z - rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
17500172             kDiff.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = w - rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
17600173
17700174             <span class="keywordflow">return</span> kDiff;
17800175         }
17900176
180<a name="l00177"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a16">00177</a>         <span class="keyword">inline</span> Vector4 <a class="code" href="namespaceOgre.html#a617">operator * </a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar )<span class="keyword"> const</span>
18100178 <span class="keyword">        </span>{
18200179             Vector4 kProd;
18300180
18400181             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = fScalar*x;
18500182             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = fScalar*y;
18600183             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = fScalar*z;
18700184             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = fScalar*w;
18800185
18900186             <span class="keywordflow">return</span> kProd;
19000187         }
19100188
192<a name="l00189"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a17">00189</a>         <span class="keyword">inline</span> Vector4 <a class="code" href="namespaceOgre.html#a617">operator * </a>( <span class="keyword">const</span> Vector4&amp; rhs)<span class="keyword"> const</span>
19300190 <span class="keyword">        </span>{
19400191             Vector4 kProd;
19500192
19600193             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> * x;
19700194             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> * y;
19800195             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> * z;
19900196             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> * w;
20000197
20100198             <span class="keywordflow">return</span> kProd;
20200199         }
20300200
204<a name="l00201"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a18">00201</a>         <span class="keyword">inline</span> Vector4 <a class="code" href="namespaceOgre.html#a618">operator / </a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar )<span class="keyword"> const</span>
20500202 <span class="keyword">        </span>{
20600203             assert( fScalar != 0.0 );
20700204
20800205             Vector4 kDiv;
20900206
21000207             <a class="code" href="namespaceOgre.html#a465">Real</a> fInv = 1.0 / fScalar;
21100208             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = x * fInv;
21200209             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = y * fInv;
21300210             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = z * fInv;
21400211             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = w * fInv;
21500212
21600213             <span class="keywordflow">return</span> kDiv;
21700214         }
21800215
219<a name="l00216"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a19">00216</a>         <span class="keyword">inline</span> Vector4 <a class="code" href="namespaceOgre.html#a618">operator / </a>( <span class="keyword">const</span> Vector4&amp; rhs)<span class="keyword"> const</span>
22000217 <span class="keyword">        </span>{
22100218             Vector4 kDiv;
22200219
22300220             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = x / rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
22400221             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = y / rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
22500222             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = z / rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
22600223             kDiv.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = w / rhs.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
22700224
22800225             <span class="keywordflow">return</span> kDiv;
22900226         }
23000227
23100228
232<a name="l00229"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a20">00229</a>         <span class="keyword">inline</span> Vector4 operator - ()<span class="keyword"> const</span>
23300230 <span class="keyword">        </span>{
23400231             Vector4 kNeg;
23500232
23600233             kNeg.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = -x;
23700234             kNeg.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = -y;
23800235             kNeg.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = -z;
23900236             kNeg.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = -w;
24000237
24100238             <span class="keywordflow">return</span> kNeg;
24200239         }
24300240
244<a name="l00241"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4n0">00241</a>         <span class="keyword">inline</span> <span class="keyword">friend</span> Vector4 <a class="code" href="namespaceOgre.html#a617">operator * </a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar, <span class="keyword">const</span> Vector4&amp; rkVector )
24500242         {
24600243             Vector4 kProd;
24700244
24800245             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> = fScalar * rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
24900246             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> = fScalar * rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
25000247             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> = fScalar * rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
25100248             kProd.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a> = fScalar * rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
25200249
25300250             <span class="keywordflow">return</span> kProd;
25400251         }
25500252
256<a name="l00253"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4n1">00253</a>         <span class="keyword">inline</span> <span class="keyword">friend</span> Vector4 operator + (<span class="keyword">const</span> Vector4&amp; lhs, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> rhs)
25700254         {
25800255             Vector4 ret;
25900256             ret = rhs;
26000257             <span class="keywordflow">return</span> ret += lhs;
26100258         }
26200259
263<a name="l00260"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4n2">00260</a>         <span class="keyword">inline</span> <span class="keyword">friend</span> Vector4 operator + (<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> lhs, <span class="keyword">const</span> Vector4&amp; rhs)
26400261         {
26500262             Vector4 ret;
26600263             ret = lhs;
26700264             <span class="keywordflow">return</span> ret += rhs;
26800265         }
26900266
270<a name="l00267"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4n3">00267</a>         <span class="keyword">inline</span> <span class="keyword">friend</span> Vector4 operator - (<span class="keyword">const</span> Vector4&amp; lhs, <a class="code" href="namespaceOgre.html#a465">Real</a> rhs)
27100268         {
27200269             Vector4 ret;
27300270             ret = lhs;
27400271             <span class="keywordflow">return</span> ret -= rhs;
27500272         }
27600273
277<a name="l00274"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4n4">00274</a>         <span class="keyword">inline</span> <span class="keyword">friend</span> Vector4 operator - (<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> lhs, <span class="keyword">const</span> Vector4&amp; rhs)
27800275         {
27900276             Vector4 ret;
28000277             ret = lhs;
28100278             <span class="keywordflow">return</span> ret -= rhs;
28200279         }
28300280
28400281         <span class="comment">// arithmetic updates</span>
285<a name="l00282"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a21">00282</a>         <span class="keyword">inline</span> Vector4&amp; operator += ( <span class="keyword">const</span> Vector4&amp; rkVector )
28600283         {
28700284             x += rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
28800285             y += rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
28900286             z += rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
29000287             w += rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
29100288
29200289             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
29300290         }
29400291
295<a name="l00292"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a22">00292</a>         <span class="keyword">inline</span> Vector4&amp; operator -= ( <span class="keyword">const</span> Vector4&amp; rkVector )
29600293         {
29700294             x -= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
29800295             y -= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
29900296             z -= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
30000297             w -= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
30100298
30200299             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
30300300         }
30400301
305<a name="l00302"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a23">00302</a>         <span class="keyword">inline</span> Vector4&amp; operator *= ( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar )
30600303         {
30700304             x *= fScalar;
30800305             y *= fScalar;
30900306             z *= fScalar;
31000307             w *= fScalar;
31100308             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
31200309         }
31300310
314<a name="l00311"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a24">00311</a>         <span class="keyword">inline</span> Vector4&amp; operator += ( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar )
31500312         {
31600313             x += fScalar;
31700314             y += fScalar;
31800315             z += fScalar;
31900316             w += fScalar;
32000317             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
32100318         }
32200319
323<a name="l00320"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a25">00320</a>         <span class="keyword">inline</span> Vector4&amp; operator -= ( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar )
32400321         {
32500322             x -= fScalar;
32600323             y -= fScalar;
32700324             z -= fScalar;
32800325             w -= fScalar;
32900326             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
33000327         }
33100328
332<a name="l00329"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a26">00329</a>         <span class="keyword">inline</span> Vector4&amp; operator *= ( <span class="keyword">const</span> Vector4&amp; rkVector )
33300330         {
33400331             x *= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
33500332             y *= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
33600333             z *= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
33700334             w *= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
33800335
33900336             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
34000337         }
34100338
342<a name="l00339"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a27">00339</a>         <span class="keyword">inline</span> Vector4&amp; operator /= ( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a465">Real</a> fScalar )
34300340         {
34400341             assert( fScalar != 0.0 );
34500342
34600343             <a class="code" href="namespaceOgre.html#a465">Real</a> fInv = 1.0 / fScalar;
34700344
34800345             x *= fInv;
34900346             y *= fInv;
35000347             z *= fInv;
35100348             w *= fInv;
35200349
35300350             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
35400351         }
35500352
356<a name="l00353"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a28">00353</a>         <span class="keyword">inline</span> Vector4&amp; operator /= ( <span class="keyword">const</span> Vector4&amp; rkVector )
35700354         {
35800355             x /= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a>;
35900356             y /= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a>;
36000357             z /= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a>;
36100358             w /= rkVector.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
36200359
36300360             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
36400361         }
36500362
366<a name="l00370"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4a29">00370</a>         <span class="keyword">inline</span> <a class="code" href="namespaceOgre.html#a465">Real</a> dotProduct(<span class="keyword">const</span> Vector4&amp; vec)<span class="keyword"> const</span>
36700371 <span class="keyword">        </span>{
36800372             <span class="keywordflow">return</span> x * vec.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o0">x</a> + y * vec.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o1">y</a> + z * vec.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o2">z</a> + w * vec.<a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4o3">w</a>;
36900373         }
37000376         <span class="keyword">inline</span> <a class="code" href="class__OgreExport.html">_OgreExport</a> <span class="keyword">friend</span> std::ostream&amp; <span class="keyword">operator</span> &lt;&lt;
371<a name="l00377"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4n5">00377</a>             ( std::ostream&amp; o, <span class="keyword">const</span> Vector4&amp; v )
37200378         {
37300379             o &lt;&lt; <span class="stringliteral">"Vector4("</span> &lt;&lt; v.x &lt;&lt; <span class="stringliteral">", "</span> &lt;&lt; v.y &lt;&lt; <span class="stringliteral">", "</span> &lt;&lt; v.z &lt;&lt; <span class="stringliteral">", "</span> &lt;&lt; v.w &lt;&lt; <span class="stringliteral">")"</span>;
37400380             <span class="keywordflow">return</span> o;
37500381         }
37600382         <span class="comment">// special</span>
377<a name="l00383"></a><a class="code" href="classOgre_1_1Vector4.html#Ogre_1_1Vector4s0">00383</a>         <span class="keyword">static</span> <span class="keyword">const</span> Vector4 ZERO;
37800384     };
37900385
38000386 }
38100387 <span class="preprocessor">#endif</span>
382</pre></div><hr>
383<p>
384Copyright &copy; 2000-2005 by The OGRE Team<br />
385<!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/>
386This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/>
387                <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
388                <Work rdf:about="">
389                        <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" />
390        <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
391                </Work>
392                <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> -->
393
394Last modified Sun Mar 12 14:37:51 2006
395</p>
396</body>
397</html>
Note: See TracBrowser for help on using the repository browser.