1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
<html>
<head>
<title>NVIDIA(R) PhysX(R) SDK 3.4 API Reference: PxQuat.h Source File</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">
</head>
<body bgcolor="#FFFFFF">
<div id="header">
<hr class="first">
<img alt="" src="images/PhysXlogo.png" align="middle"> <br>
<center>
<a class="qindex" href="main.html">Main Page</a>
<a class="qindex" href="hierarchy.html">Class Hierarchy</a>
<a class="qindex" href="annotated.html">Compound List</a>
<a class="qindex" href="functions.html">Compound Members</a>
</center>
<hr class="second">
</div>
<!-- Generated by Doxygen 1.5.8 -->
<h1>PxQuat.h</h1><a href="PxQuat_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span>
<a name="l00002"></a>00002 <span class="comment">// Redistribution and use in source and binary forms, with or without</span>
<a name="l00003"></a>00003 <span class="comment">// modification, are permitted provided that the following conditions</span>
<a name="l00004"></a>00004 <span class="comment">// are met:</span>
<a name="l00005"></a>00005 <span class="comment">// * Redistributions of source code must retain the above copyright</span>
<a name="l00006"></a>00006 <span class="comment">// notice, this list of conditions and the following disclaimer.</span>
<a name="l00007"></a>00007 <span class="comment">// * Redistributions in binary form must reproduce the above copyright</span>
<a name="l00008"></a>00008 <span class="comment">// notice, this list of conditions and the following disclaimer in the</span>
<a name="l00009"></a>00009 <span class="comment">// documentation and/or other materials provided with the distribution.</span>
<a name="l00010"></a>00010 <span class="comment">// * Neither the name of NVIDIA CORPORATION nor the names of its</span>
<a name="l00011"></a>00011 <span class="comment">// contributors may be used to endorse or promote products derived</span>
<a name="l00012"></a>00012 <span class="comment">// from this software without specific prior written permission.</span>
<a name="l00013"></a>00013 <span class="comment">//</span>
<a name="l00014"></a>00014 <span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY</span>
<a name="l00015"></a>00015 <span class="comment">// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
<a name="l00016"></a>00016 <span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span>
<a name="l00017"></a>00017 <span class="comment">// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR</span>
<a name="l00018"></a>00018 <span class="comment">// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span>
<a name="l00019"></a>00019 <span class="comment">// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span>
<a name="l00020"></a>00020 <span class="comment">// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span>
<a name="l00021"></a>00021 <span class="comment">// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY</span>
<a name="l00022"></a>00022 <span class="comment">// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00023"></a>00023 <span class="comment">// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span>
<a name="l00024"></a>00024 <span class="comment">// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.</span>
<a name="l00027"></a>00027 <span class="comment">// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.</span>
<a name="l00028"></a>00028 <span class="comment">// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.</span>
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef PXFOUNDATION_PXQUAT_H</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define PXFOUNDATION_PXQUAT_H</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="PxVec3_8h.html">foundation/PxVec3.h</a>"</span>
<a name="l00038"></a>00038 <span class="preprocessor">#if !PX_DOXYGEN</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="keyword">namespace </span>physx
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041 <span class="preprocessor">#endif</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00049"></a><a class="code" href="classPxQuat.html">00049</a> <span class="keyword">class </span><a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051 <span class="keyword">public</span>:
<a name="l00055"></a><a class="code" href="classPxQuat.html#fac7f63b57840965157cf720bb6faddc">00055</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>()
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 }
<a name="l00058"></a>00058
<a name="l00060"></a><a class="code" href="classPxQuat.html#13d4cf835204d37e90fecef45659c790">00060</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(<a class="code" href="group__foundation.html#g70160ca5bbafef277790b3e0f12baf38">PxIDENTITY</a> r) : x(0.0f), y(0.0f), z(0.0f), w(1.0f)
<a name="l00061"></a>00061 {
<a name="l00062"></a>00062 <a class="code" href="group__foundation.html#g3b618390d8743c532c4131cb931df43a">PX_UNUSED</a>(r);
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064
<a name="l00068"></a><a class="code" href="classPxQuat.html#b364d7ce854065cd32b2dbbd8d30e279">00068</a> <span class="keyword">explicit</span> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(<span class="keywordtype">float</span> r) : x(0.0f), y(0.0f), z(0.0f), w(r)
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070 }
<a name="l00071"></a>00071
<a name="l00075"></a><a class="code" href="classPxQuat.html#ffc77743ed2c2cd3a90749de917187b0">00075</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(<span class="keywordtype">float</span> nx, <span class="keywordtype">float</span> ny, <span class="keywordtype">float</span> nz, <span class="keywordtype">float</span> nw) : x(nx), y(ny), z(nz), w(nw)
<a name="l00076"></a>00076 {
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078
<a name="l00088"></a><a class="code" href="classPxQuat.html#96cdb8dff7a2ed40a71912edf19dd812">00088</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(<span class="keywordtype">float</span> angleRadians, <span class="keyword">const</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>& unitAxis)
<a name="l00089"></a>00089 {
<a name="l00090"></a>00090 <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(<a class="code" href="group__foundation.html#gf72e1dce9e874da7b92cbc0ea5e4e30d" title="abs returns the absolute value of its argument.">PxAbs</a>(1.0f - unitAxis.<a class="code" href="classPxVec3.html#484f52dfb6f012cd492f8321bc1b4d42" title="returns the magnitude">magnitude</a>()) < 1e-3f);
<a name="l00091"></a>00091 <span class="keyword">const</span> <span class="keywordtype">float</span> a = angleRadians * 0.5f;
<a name="l00092"></a>00092 <span class="keyword">const</span> <span class="keywordtype">float</span> s = <a class="code" href="group__foundation.html#g98f571cc01fc3aa0e73e215c27ab8069" title="trigonometry -- all angles are in radians.">PxSin</a>(a);
<a name="l00093"></a>00093 w = <a class="code" href="group__foundation.html#gcc501523ad3ab46c5a061c4442d10fcf" title="Cosine of an angle (Unit: Radians).">PxCos</a>(a);
<a name="l00094"></a>00094 x = unitAxis.<a class="code" href="classPxVec3.html#391194bca8291161c06254f4ac2b6ada">x</a> * s;
<a name="l00095"></a>00095 y = unitAxis.<a class="code" href="classPxVec3.html#29958700f50da2204edc519b47706a05">y</a> * s;
<a name="l00096"></a>00096 z = unitAxis.<a class="code" href="classPxVec3.html#50d67b162b99b904c3f362ad0415dbca">z</a> * s;
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098
<a name="l00102"></a><a class="code" href="classPxQuat.html#e12a02d9cb43b5e2c7dc083563cf1586">00102</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& v) : x(v.x), y(v.y), z(v.z), w(v.w)
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105
<a name="l00111"></a>00111 <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keyword">explicit</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(<span class="keyword">const</span> <a class="code" href="classPxMat33.html" title="3x3 matrix class">PxMat33</a>& m); <span class="comment">/* defined in PxMat33.h */</span>
<a name="l00112"></a>00112
<a name="l00116"></a><a class="code" href="classPxQuat.html#7535248b780fc139b72905bcf5c1f922">00116</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <span class="keywordtype">bool</span> isIdentity()<span class="keyword"> const</span>
<a name="l00117"></a>00117 <span class="keyword"> </span>{
<a name="l00118"></a>00118 <span class="keywordflow">return</span> x==0.0f && y==0.0f && z==0.0f && w==1.0f;
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120
<a name="l00124"></a><a class="code" href="classPxQuat.html#a435b2284fdc3d4ad85bec6074f2bad4">00124</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <span class="keywordtype">bool</span> isFinite()<span class="keyword"> const</span>
<a name="l00125"></a>00125 <span class="keyword"> </span>{
<a name="l00126"></a>00126 <span class="keywordflow">return</span> <a class="code" href="group__foundation.html#gd6de0f4af98c5c5280b8fe695dc87318" title="returns true if the passed number is a finite floating point number as opposed to...">PxIsFinite</a>(x) && <a class="code" href="group__foundation.html#gd6de0f4af98c5c5280b8fe695dc87318" title="returns true if the passed number is a finite floating point number as opposed to...">PxIsFinite</a>(y) && <a class="code" href="group__foundation.html#gd6de0f4af98c5c5280b8fe695dc87318" title="returns true if the passed number is a finite floating point number as opposed to...">PxIsFinite</a>(z) && <a class="code" href="group__foundation.html#gd6de0f4af98c5c5280b8fe695dc87318" title="returns true if the passed number is a finite floating point number as opposed to...">PxIsFinite</a>(w);
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128
<a name="l00132"></a><a class="code" href="classPxQuat.html#3890ca4efba038ab0fc84bb39c5267db">00132</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <span class="keywordtype">bool</span> isUnit()<span class="keyword"> const</span>
<a name="l00133"></a>00133 <span class="keyword"> </span>{
<a name="l00134"></a>00134 <span class="keyword">const</span> <span class="keywordtype">float</span> unitTolerance = 1e-4f;
<a name="l00135"></a>00135 <span class="keywordflow">return</span> isFinite() && <a class="code" href="group__foundation.html#gf72e1dce9e874da7b92cbc0ea5e4e30d" title="abs returns the absolute value of its argument.">PxAbs</a>(magnitude() - 1) < unitTolerance;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137
<a name="l00142"></a><a class="code" href="classPxQuat.html#935090e7b3017e74a7f8dae595bcaec9">00142</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <span class="keywordtype">bool</span> isSane()<span class="keyword"> const</span>
<a name="l00143"></a>00143 <span class="keyword"> </span>{
<a name="l00144"></a>00144 <span class="keyword">const</span> <span class="keywordtype">float</span> unitTolerance = 1e-2f;
<a name="l00145"></a>00145 <span class="keywordflow">return</span> isFinite() && <a class="code" href="group__foundation.html#gf72e1dce9e874da7b92cbc0ea5e4e30d" title="abs returns the absolute value of its argument.">PxAbs</a>(magnitude() - 1) < unitTolerance;
<a name="l00146"></a>00146 }
<a name="l00147"></a>00147
<a name="l00151"></a><a class="code" href="classPxQuat.html#9da7a84ebce6482bbeba84e60c83ac20">00151</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)<span class="keyword"> const</span>
<a name="l00152"></a>00152 <span class="keyword"> </span>{
<a name="l00153"></a>00153 <span class="keywordflow">return</span> x == q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> && y == q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> && z == q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> && w == q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>;
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155
<a name="l00159"></a><a class="code" href="classPxQuat.html#6fe471d2db21c719e53e21b520dcbbac">00159</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> toRadiansAndUnitAxis(<span class="keywordtype">float</span>& angle, <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>& axis)<span class="keyword"> const</span>
<a name="l00160"></a>00160 <span class="keyword"> </span>{
<a name="l00161"></a>00161 <span class="keyword">const</span> <span class="keywordtype">float</span> quatEpsilon = 1.0e-8f;
<a name="l00162"></a>00162 <span class="keyword">const</span> <span class="keywordtype">float</span> s2 = x * x + y * y + z * z;
<a name="l00163"></a>00163 <span class="keywordflow">if</span>(s2 < quatEpsilon * quatEpsilon) <span class="comment">// can't extract a sensible axis</span>
<a name="l00164"></a>00164 {
<a name="l00165"></a>00165 angle = 0.0f;
<a name="l00166"></a>00166 axis = <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>(1.0f, 0.0f, 0.0f);
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168 <span class="keywordflow">else</span>
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170 <span class="keyword">const</span> <span class="keywordtype">float</span> s = <a class="code" href="group__foundation.html#gcd945627f345ba03e83a30387ab99dea" title="reciprocal square root.">PxRecipSqrt</a>(s2);
<a name="l00171"></a>00171 axis = <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>(x, y, z) * s;
<a name="l00172"></a>00172 angle = <a class="code" href="group__foundation.html#gf72e1dce9e874da7b92cbc0ea5e4e30d" title="abs returns the absolute value of its argument.">PxAbs</a>(w) < quatEpsilon ? <a class="code" href="group__foundation.html#gbcd49a429b8119de54375b3538ae8a8d">PxPi</a> : <a class="code" href="group__foundation.html#g3b820cf45fee058a4083d955daa02154" title="Arctangent of (x/y) with correct sign. Returns angle between -PI and PI in radians...">PxAtan2</a>(s2 * s, w) * 2.0f;
<a name="l00173"></a>00173 }
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175
<a name="l00181"></a><a class="code" href="classPxQuat.html#f625481b6f1431bef8eefcc22f2497de">00181</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">float</span> getAngle()<span class="keyword"> const</span>
<a name="l00182"></a>00182 <span class="keyword"> </span>{
<a name="l00183"></a>00183 <span class="keywordflow">return</span> <a class="code" href="group__foundation.html#g0953977efc7599071aefadc35e842f97" title="Arccosine. Returns angle between 0 and PI in radians Unit: Radians.">PxAcos</a>(w) * 2.0f;
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185
<a name="l00191"></a><a class="code" href="classPxQuat.html#c77bec66cbe4760a4bffbcd51c495253">00191</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">float</span> getAngle(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)<span class="keyword"> const</span>
<a name="l00192"></a>00192 <span class="keyword"> </span>{
<a name="l00193"></a>00193 <span class="keywordflow">return</span> <a class="code" href="group__foundation.html#g0953977efc7599071aefadc35e842f97" title="Arccosine. Returns angle between 0 and PI in radians Unit: Radians.">PxAcos</a>(dot(q)) * 2.0f;
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195
<a name="l00199"></a><a class="code" href="classPxQuat.html#765d6d921bcacc14a2548205eb32b402">00199</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <span class="keywordtype">float</span> magnitudeSquared()<span class="keyword"> const</span>
<a name="l00200"></a>00200 <span class="keyword"> </span>{
<a name="l00201"></a>00201 <span class="keywordflow">return</span> x * x + y * y + z * z + w * w;
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203
<a name="l00207"></a><a class="code" href="classPxQuat.html#c41840a9219dd8c85c61233020ffab5a">00207</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <span class="keywordtype">float</span> dot(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& v)<span class="keyword"> const</span>
<a name="l00208"></a>00208 <span class="keyword"> </span>{
<a name="l00209"></a>00209 <span class="keywordflow">return</span> x * v.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> + y * v.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> + z * v.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> + w * v.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>;
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211
<a name="l00212"></a><a class="code" href="classPxQuat.html#a9cff7e69cad7e5a681a3ff471efd5cb">00212</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> getNormalized()<span class="keyword"> const</span>
<a name="l00213"></a>00213 <span class="keyword"> </span>{
<a name="l00214"></a>00214 <span class="keyword">const</span> <span class="keywordtype">float</span> s = 1.0f / magnitude();
<a name="l00215"></a>00215 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(x * s, y * s, z * s, w * s);
<a name="l00216"></a>00216 }
<a name="l00217"></a>00217
<a name="l00218"></a><a class="code" href="classPxQuat.html#b9a78b5618f8e4b892c91f9fd66a680e">00218</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">float</span> magnitude()<span class="keyword"> const</span>
<a name="l00219"></a>00219 <span class="keyword"> </span>{
<a name="l00220"></a>00220 <span class="keywordflow">return</span> <a class="code" href="group__foundation.html#g11d5e4e77acad728886b380b5f3806f0" title="Square root.">PxSqrt</a>(magnitudeSquared());
<a name="l00221"></a>00221 }
<a name="l00222"></a>00222
<a name="l00223"></a>00223 <span class="comment">// modifiers:</span>
<a name="l00227"></a><a class="code" href="classPxQuat.html#77a42662202126a13f2f9fc12013fe70">00227</a> <span class="comment"></span> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">float</span> normalize() <span class="comment">// convert this PxQuat to a unit quaternion</span>
<a name="l00228"></a>00228 {
<a name="l00229"></a>00229 <span class="keyword">const</span> <span class="keywordtype">float</span> mag = magnitude();
<a name="l00230"></a>00230 <span class="keywordflow">if</span>(mag != 0.0f)
<a name="l00231"></a>00231 {
<a name="l00232"></a>00232 <span class="keyword">const</span> <span class="keywordtype">float</span> imag = 1.0f / mag;
<a name="l00233"></a>00233
<a name="l00234"></a>00234 x *= imag;
<a name="l00235"></a>00235 y *= imag;
<a name="l00236"></a>00236 z *= imag;
<a name="l00237"></a>00237 w *= imag;
<a name="l00238"></a>00238 }
<a name="l00239"></a>00239 <span class="keywordflow">return</span> mag;
<a name="l00240"></a>00240 }
<a name="l00241"></a>00241
<a name="l00242"></a>00242 <span class="comment">/*</span>
<a name="l00243"></a>00243 <span class="comment"> \brief returns the conjugate.</span>
<a name="l00244"></a>00244 <span class="comment"></span>
<a name="l00245"></a>00245 <span class="comment"> \note for unit quaternions, this is the inverse.</span>
<a name="l00246"></a>00246 <span class="comment"> */</span>
<a name="l00247"></a><a class="code" href="classPxQuat.html#a4418a046f8851753a23a375515b0614">00247</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> getConjugate()<span class="keyword"> const</span>
<a name="l00248"></a>00248 <span class="keyword"> </span>{
<a name="l00249"></a>00249 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(-x, -y, -z, w);
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251
<a name="l00252"></a>00252 <span class="comment">/*</span>
<a name="l00253"></a>00253 <span class="comment"> \brief returns imaginary part.</span>
<a name="l00254"></a>00254 <span class="comment"> */</span>
<a name="l00255"></a><a class="code" href="classPxQuat.html#f75c924f631c9ae608821a05b9b59a7f">00255</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a> getImaginaryPart()<span class="keyword"> const</span>
<a name="l00256"></a>00256 <span class="keyword"> </span>{
<a name="l00257"></a>00257 <span class="keywordflow">return</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>(x, y, z);
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259
<a name="l00261"></a><a class="code" href="classPxQuat.html#609e8019db1d8d8ae1e007e160f5e4f6">00261</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a> getBasisVector0()<span class="keyword"> const</span>
<a name="l00262"></a>00262 <span class="keyword"> </span>{
<a name="l00263"></a>00263 <span class="keyword">const</span> <span class="keywordtype">float</span> x2 = x * 2.0f;
<a name="l00264"></a>00264 <span class="keyword">const</span> <span class="keywordtype">float</span> w2 = w * 2.0f;
<a name="l00265"></a>00265 <span class="keywordflow">return</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>((w * w2) - 1.0f + x * x2, (z * w2) + y * x2, (-y * w2) + z * x2);
<a name="l00266"></a>00266 }
<a name="l00267"></a>00267
<a name="l00269"></a><a class="code" href="classPxQuat.html#1f4c3fff7fffc8694d04298f36696b82">00269</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a> getBasisVector1()<span class="keyword"> const</span>
<a name="l00270"></a>00270 <span class="keyword"> </span>{
<a name="l00271"></a>00271 <span class="keyword">const</span> <span class="keywordtype">float</span> y2 = y * 2.0f;
<a name="l00272"></a>00272 <span class="keyword">const</span> <span class="keywordtype">float</span> w2 = w * 2.0f;
<a name="l00273"></a>00273 <span class="keywordflow">return</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>((-z * w2) + x * y2, (w * w2) - 1.0f + y * y2, (x * w2) + z * y2);
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275
<a name="l00277"></a><a class="code" href="classPxQuat.html#4b77458e75985b09bce8a933e83193c5">00277</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a> getBasisVector2()<span class="keyword"> const</span>
<a name="l00278"></a>00278 <span class="keyword"> </span>{
<a name="l00279"></a>00279 <span class="keyword">const</span> <span class="keywordtype">float</span> z2 = z * 2.0f;
<a name="l00280"></a>00280 <span class="keyword">const</span> <span class="keywordtype">float</span> w2 = w * 2.0f;
<a name="l00281"></a>00281 <span class="keywordflow">return</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>((y * w2) + x * z2, (-x * w2) + y * z2, (w * w2) - 1.0f + z * z2);
<a name="l00282"></a>00282 }
<a name="l00283"></a>00283
<a name="l00287"></a><a class="code" href="classPxQuat.html#b5ffbf8b2b7bd871e6ac0b854fd5730e">00287</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <span class="keyword">const</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a> rotate(<span class="keyword">const</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>& v)<span class="keyword"> const</span>
<a name="l00288"></a>00288 <span class="keyword"> </span>{
<a name="l00289"></a>00289 <span class="keyword">const</span> <span class="keywordtype">float</span> vx = 2.0f * v.<a class="code" href="classPxVec3.html#391194bca8291161c06254f4ac2b6ada">x</a>;
<a name="l00290"></a>00290 <span class="keyword">const</span> <span class="keywordtype">float</span> vy = 2.0f * v.<a class="code" href="classPxVec3.html#29958700f50da2204edc519b47706a05">y</a>;
<a name="l00291"></a>00291 <span class="keyword">const</span> <span class="keywordtype">float</span> vz = 2.0f * v.<a class="code" href="classPxVec3.html#50d67b162b99b904c3f362ad0415dbca">z</a>;
<a name="l00292"></a>00292 <span class="keyword">const</span> <span class="keywordtype">float</span> w2 = w * w - 0.5f;
<a name="l00293"></a>00293 <span class="keyword">const</span> <span class="keywordtype">float</span> dot2 = (x * vx + y * vy + z * vz);
<a name="l00294"></a>00294 <span class="keywordflow">return</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>((vx * w2 + (y * vz - z * vy) * w + x * dot2), (vy * w2 + (z * vx - x * vz) * w + y * dot2),
<a name="l00295"></a>00295 (vz * w2 + (x * vy - y * vx) * w + z * dot2));
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297
<a name="l00301"></a><a class="code" href="classPxQuat.html#6ce4a234b750b076459632e60579cf78">00301</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <span class="keyword">const</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a> rotateInv(<span class="keyword">const</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>& v)<span class="keyword"> const</span>
<a name="l00302"></a>00302 <span class="keyword"> </span>{
<a name="l00303"></a>00303 <span class="keyword">const</span> <span class="keywordtype">float</span> vx = 2.0f * v.<a class="code" href="classPxVec3.html#391194bca8291161c06254f4ac2b6ada">x</a>;
<a name="l00304"></a>00304 <span class="keyword">const</span> <span class="keywordtype">float</span> vy = 2.0f * v.<a class="code" href="classPxVec3.html#29958700f50da2204edc519b47706a05">y</a>;
<a name="l00305"></a>00305 <span class="keyword">const</span> <span class="keywordtype">float</span> vz = 2.0f * v.<a class="code" href="classPxVec3.html#50d67b162b99b904c3f362ad0415dbca">z</a>;
<a name="l00306"></a>00306 <span class="keyword">const</span> <span class="keywordtype">float</span> w2 = w * w - 0.5f;
<a name="l00307"></a>00307 <span class="keyword">const</span> <span class="keywordtype">float</span> dot2 = (x * vx + y * vy + z * vz);
<a name="l00308"></a>00308 <span class="keywordflow">return</span> <a class="code" href="classPxVec3.html" title="3 Element vector class.">PxVec3</a>((vx * w2 - (y * vz - z * vy) * w + x * dot2), (vy * w2 - (z * vx - x * vz) * w + y * dot2),
<a name="l00309"></a>00309 (vz * w2 - (x * vy - y * vx) * w + z * dot2));
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311
<a name="l00315"></a><a class="code" href="classPxQuat.html#4f3ea9ae559903398b3c973458a6aa11">00315</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& operator=(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& p)
<a name="l00316"></a>00316 {
<a name="l00317"></a>00317 x = p.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a>;
<a name="l00318"></a>00318 y = p.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a>;
<a name="l00319"></a>00319 z = p.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a>;
<a name="l00320"></a>00320 w = p.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>;
<a name="l00321"></a>00321 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00322"></a>00322 }
<a name="l00323"></a>00323
<a name="l00324"></a><a class="code" href="classPxQuat.html#06c67f76789048d93e5119e2ef7b9451">00324</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& operator*=(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)
<a name="l00325"></a>00325 {
<a name="l00326"></a>00326 <span class="keyword">const</span> <span class="keywordtype">float</span> tx = w * q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> * x + y * q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> - q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> * z;
<a name="l00327"></a>00327 <span class="keyword">const</span> <span class="keywordtype">float</span> ty = w * q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> * y + z * q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> - q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> * x;
<a name="l00328"></a>00328 <span class="keyword">const</span> <span class="keywordtype">float</span> tz = w * q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> * z + x * q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> - q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> * y;
<a name="l00329"></a>00329
<a name="l00330"></a>00330 w = w * q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> - q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> * x - y * q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> - q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> * z;
<a name="l00331"></a>00331 x = tx;
<a name="l00332"></a>00332 y = ty;
<a name="l00333"></a>00333 z = tz;
<a name="l00334"></a>00334
<a name="l00335"></a>00335 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00336"></a>00336 }
<a name="l00337"></a>00337
<a name="l00338"></a><a class="code" href="classPxQuat.html#2ab2f7c410b2dfeedf984d9c29264c10">00338</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& operator+=(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)
<a name="l00339"></a>00339 {
<a name="l00340"></a>00340 x += q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a>;
<a name="l00341"></a>00341 y += q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a>;
<a name="l00342"></a>00342 z += q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a>;
<a name="l00343"></a>00343 w += q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>;
<a name="l00344"></a>00344 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00345"></a>00345 }
<a name="l00346"></a>00346
<a name="l00347"></a><a class="code" href="classPxQuat.html#00e4863332f965bb73a8849718062677">00347</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& operator-=(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)
<a name="l00348"></a>00348 {
<a name="l00349"></a>00349 x -= q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a>;
<a name="l00350"></a>00350 y -= q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a>;
<a name="l00351"></a>00351 z -= q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a>;
<a name="l00352"></a>00352 w -= q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>;
<a name="l00353"></a>00353 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00354"></a>00354 }
<a name="l00355"></a>00355
<a name="l00356"></a><a class="code" href="classPxQuat.html#293e12f666d5877f0de4b230f119a125">00356</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& operator*=(<span class="keyword">const</span> <span class="keywordtype">float</span> s)
<a name="l00357"></a>00357 {
<a name="l00358"></a>00358 x *= s;
<a name="l00359"></a>00359 y *= s;
<a name="l00360"></a>00360 z *= s;
<a name="l00361"></a>00361 w *= s;
<a name="l00362"></a>00362 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00363"></a>00363 }
<a name="l00364"></a>00364
<a name="l00366"></a><a class="code" href="classPxQuat.html#67da1625a38e2b44a0e9850dd67a0789">00366</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> <a class="code" href="group__foundation.html#ga7415102b45174d3eda4d4f2f12127bc">operator*</a>(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)<span class="keyword"> const</span>
<a name="l00367"></a>00367 <span class="keyword"> </span>{
<a name="l00368"></a>00368 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(w * q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> * x + y * q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> - q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> * z, w * q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> * y + z * q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> - q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> * x,
<a name="l00369"></a>00369 w * q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a> + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> * z + x * q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> - q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> * y, w * q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a> - x * q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a> - y * q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a> - z * q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a>);
<a name="l00370"></a>00370 }
<a name="l00371"></a>00371
<a name="l00373"></a><a class="code" href="classPxQuat.html#b57226b2f11124a0df3ef50b167495c1">00373</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> <a class="code" href="group__foundation.html#g9f9ec0bd1ad1ead5b8d88ff933363cad" title="Addition operator.">operator+</a>(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)<span class="keyword"> const</span>
<a name="l00374"></a>00374 <span class="keyword"> </span>{
<a name="l00375"></a>00375 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(x + q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a>, y + q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a>, z + q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a>, w + q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>);
<a name="l00376"></a>00376 }
<a name="l00377"></a>00377
<a name="l00379"></a><a class="code" href="classPxQuat.html#5d4f0fe6c51fab6f0d1731a84168faa3">00379</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> operator-()<span class="keyword"> const</span>
<a name="l00380"></a>00380 <span class="keyword"> </span>{
<a name="l00381"></a>00381 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(-x, -y, -z, -w);
<a name="l00382"></a>00382 }
<a name="l00383"></a>00383
<a name="l00384"></a><a class="code" href="classPxQuat.html#543fc02097d753e9b28377873cfe1f29">00384</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> operator-(<span class="keyword">const</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>& q)<span class="keyword"> const</span>
<a name="l00385"></a>00385 <span class="keyword"> </span>{
<a name="l00386"></a>00386 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(x - q.<a class="code" href="classPxQuat.html#c7275be0f2d9162cff34b2d43f2ab179">x</a>, y - q.<a class="code" href="classPxQuat.html#0988cef7bc3fbdcd8cf37974c5edd611">y</a>, z - q.<a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">z</a>, w - q.<a class="code" href="classPxQuat.html#84fb33d995ed4e6a26ac3f22523f0b54">w</a>);
<a name="l00387"></a>00387 }
<a name="l00388"></a>00388
<a name="l00389"></a><a class="code" href="classPxQuat.html#0d15d51d10b18624f05f2ca0d2c71ba4">00389</a> <a class="code" href="group__foundation.html#g6e444d58dbf1459261fadc9b79594f63">PX_CUDA_CALLABLE</a> <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a> <a class="code" href="group__foundation.html#ga7415102b45174d3eda4d4f2f12127bc">operator*</a>(<span class="keywordtype">float</span> r)<span class="keyword"> const</span>
<a name="l00390"></a>00390 <span class="keyword"> </span>{
<a name="l00391"></a>00391 <span class="keywordflow">return</span> <a class="code" href="classPxQuat.html" title="This is a quaternion class. For more information on quaternion mathematics consult...">PxQuat</a>(x * r, y * r, z * r, w * r);
<a name="l00392"></a>00392 }
<a name="l00393"></a>00393
<a name="l00395"></a><a class="code" href="classPxQuat.html#6773bfd82393a8dde22ddef5f0900d06">00395</a> <span class="keywordtype">float</span> x, y, z, w;
<a name="l00396"></a>00396 };
<a name="l00397"></a>00397
<a name="l00398"></a>00398 <span class="preprocessor">#if !PX_DOXYGEN</span>
<a name="l00399"></a>00399 <span class="preprocessor"></span>} <span class="comment">// namespace physx</span>
<a name="l00400"></a>00400 <span class="preprocessor">#endif</span>
<a name="l00401"></a>00401 <span class="preprocessor"></span>
<a name="l00403"></a>00403 <span class="preprocessor">#endif // #ifndef PXFOUNDATION_PXQUAT_H</span>
</pre></div></div>
<hr style="width: 100%; height: 2px;"><br>
Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a>
</body>
</html>
|