rev |
line source |
nuclear@0
|
1 /*
|
nuclear@0
|
2 ---------------------------------------------------------------------------
|
nuclear@0
|
3 Open Asset Import Library (assimp)
|
nuclear@0
|
4 ---------------------------------------------------------------------------
|
nuclear@0
|
5
|
nuclear@0
|
6 Copyright (c) 2006-2018, assimp team
|
nuclear@0
|
7
|
nuclear@0
|
8
|
nuclear@0
|
9
|
nuclear@0
|
10 All rights reserved.
|
nuclear@0
|
11
|
nuclear@0
|
12 Redistribution and use of this software in source and binary forms,
|
nuclear@0
|
13 with or without modification, are permitted provided that the following
|
nuclear@0
|
14 conditions are met:
|
nuclear@0
|
15
|
nuclear@0
|
16 * Redistributions of source code must retain the above
|
nuclear@0
|
17 copyright notice, this list of conditions and the
|
nuclear@0
|
18 following disclaimer.
|
nuclear@0
|
19
|
nuclear@0
|
20 * Redistributions in binary form must reproduce the above
|
nuclear@0
|
21 copyright notice, this list of conditions and the
|
nuclear@0
|
22 following disclaimer in the documentation and/or other
|
nuclear@0
|
23 materials provided with the distribution.
|
nuclear@0
|
24
|
nuclear@0
|
25 * Neither the name of the assimp team, nor the names of its
|
nuclear@0
|
26 contributors may be used to endorse or promote products
|
nuclear@0
|
27 derived from this software without specific prior
|
nuclear@0
|
28 written permission of the assimp team.
|
nuclear@0
|
29
|
nuclear@0
|
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
nuclear@0
|
31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
nuclear@0
|
32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
nuclear@0
|
33 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
nuclear@0
|
34 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
nuclear@0
|
35 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
nuclear@0
|
36 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
nuclear@0
|
37 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
nuclear@0
|
38 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
nuclear@0
|
39 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
nuclear@0
|
40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
nuclear@0
|
41 ---------------------------------------------------------------------------
|
nuclear@0
|
42 */
|
nuclear@0
|
43
|
nuclear@0
|
44 /** @file matrix3x3.inl
|
nuclear@0
|
45 * @brief Inline implementation of the 3x3 matrix operators
|
nuclear@0
|
46 */
|
nuclear@0
|
47 #pragma once
|
nuclear@0
|
48 #ifndef AI_MATRIX3X3_INL_INC
|
nuclear@0
|
49 #define AI_MATRIX3X3_INL_INC
|
nuclear@0
|
50
|
nuclear@0
|
51 #ifdef __cplusplus
|
nuclear@0
|
52 #include "matrix3x3.h"
|
nuclear@0
|
53
|
nuclear@0
|
54 #include "matrix4x4.h"
|
nuclear@0
|
55 #include <algorithm>
|
nuclear@0
|
56 #include <cmath>
|
nuclear@0
|
57 #include <limits>
|
nuclear@0
|
58
|
nuclear@0
|
59 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
60 // Construction from a 4x4 matrix. The remaining parts of the matrix are ignored.
|
nuclear@0
|
61 template <typename TReal>
|
nuclear@0
|
62 inline aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix)
|
nuclear@0
|
63 {
|
nuclear@0
|
64 a1 = pMatrix.a1; a2 = pMatrix.a2; a3 = pMatrix.a3;
|
nuclear@0
|
65 b1 = pMatrix.b1; b2 = pMatrix.b2; b3 = pMatrix.b3;
|
nuclear@0
|
66 c1 = pMatrix.c1; c2 = pMatrix.c2; c3 = pMatrix.c3;
|
nuclear@0
|
67 }
|
nuclear@0
|
68
|
nuclear@0
|
69 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
70 template <typename TReal>
|
nuclear@0
|
71 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& m)
|
nuclear@0
|
72 {
|
nuclear@0
|
73 *this = aiMatrix3x3t<TReal>(m.a1 * a1 + m.b1 * a2 + m.c1 * a3,
|
nuclear@0
|
74 m.a2 * a1 + m.b2 * a2 + m.c2 * a3,
|
nuclear@0
|
75 m.a3 * a1 + m.b3 * a2 + m.c3 * a3,
|
nuclear@0
|
76 m.a1 * b1 + m.b1 * b2 + m.c1 * b3,
|
nuclear@0
|
77 m.a2 * b1 + m.b2 * b2 + m.c2 * b3,
|
nuclear@0
|
78 m.a3 * b1 + m.b3 * b2 + m.c3 * b3,
|
nuclear@0
|
79 m.a1 * c1 + m.b1 * c2 + m.c1 * c3,
|
nuclear@0
|
80 m.a2 * c1 + m.b2 * c2 + m.c2 * c3,
|
nuclear@0
|
81 m.a3 * c1 + m.b3 * c2 + m.c3 * c3);
|
nuclear@0
|
82 return *this;
|
nuclear@0
|
83 }
|
nuclear@0
|
84
|
nuclear@0
|
85 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
86 template <typename TReal>
|
nuclear@0
|
87 template <typename TOther>
|
nuclear@0
|
88 aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const
|
nuclear@0
|
89 {
|
nuclear@0
|
90 return aiMatrix3x3t<TOther>(static_cast<TOther>(a1),static_cast<TOther>(a2),static_cast<TOther>(a3),
|
nuclear@0
|
91 static_cast<TOther>(b1),static_cast<TOther>(b2),static_cast<TOther>(b3),
|
nuclear@0
|
92 static_cast<TOther>(c1),static_cast<TOther>(c2),static_cast<TOther>(c3));
|
nuclear@0
|
93 }
|
nuclear@0
|
94
|
nuclear@0
|
95 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
96 template <typename TReal>
|
nuclear@0
|
97 inline aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TReal>& m) const
|
nuclear@0
|
98 {
|
nuclear@0
|
99 aiMatrix3x3t<TReal> temp( *this);
|
nuclear@0
|
100 temp *= m;
|
nuclear@0
|
101 return temp;
|
nuclear@0
|
102 }
|
nuclear@0
|
103
|
nuclear@0
|
104 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
105 template <typename TReal>
|
nuclear@0
|
106 inline TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) {
|
nuclear@0
|
107 switch ( p_iIndex ) {
|
nuclear@0
|
108 case 0:
|
nuclear@0
|
109 return &a1;
|
nuclear@0
|
110 case 1:
|
nuclear@0
|
111 return &b1;
|
nuclear@0
|
112 case 2:
|
nuclear@0
|
113 return &c1;
|
nuclear@0
|
114 default:
|
nuclear@0
|
115 break;
|
nuclear@0
|
116 }
|
nuclear@0
|
117 return &a1;
|
nuclear@0
|
118 }
|
nuclear@0
|
119
|
nuclear@0
|
120 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
121 template <typename TReal>
|
nuclear@0
|
122 inline const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) const {
|
nuclear@0
|
123 switch ( p_iIndex ) {
|
nuclear@0
|
124 case 0:
|
nuclear@0
|
125 return &a1;
|
nuclear@0
|
126 case 1:
|
nuclear@0
|
127 return &b1;
|
nuclear@0
|
128 case 2:
|
nuclear@0
|
129 return &c1;
|
nuclear@0
|
130 default:
|
nuclear@0
|
131 break;
|
nuclear@0
|
132 }
|
nuclear@0
|
133 return &a1;
|
nuclear@0
|
134 }
|
nuclear@0
|
135
|
nuclear@0
|
136 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
137 template <typename TReal>
|
nuclear@0
|
138 inline bool aiMatrix3x3t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const
|
nuclear@0
|
139 {
|
nuclear@0
|
140 return a1 == m.a1 && a2 == m.a2 && a3 == m.a3 &&
|
nuclear@0
|
141 b1 == m.b1 && b2 == m.b2 && b3 == m.b3 &&
|
nuclear@0
|
142 c1 == m.c1 && c2 == m.c2 && c3 == m.c3;
|
nuclear@0
|
143 }
|
nuclear@0
|
144
|
nuclear@0
|
145 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
146 template <typename TReal>
|
nuclear@0
|
147 inline bool aiMatrix3x3t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const
|
nuclear@0
|
148 {
|
nuclear@0
|
149 return !(*this == m);
|
nuclear@0
|
150 }
|
nuclear@0
|
151
|
nuclear@0
|
152 // ---------------------------------------------------------------------------
|
nuclear@0
|
153 template<typename TReal>
|
nuclear@0
|
154 inline bool aiMatrix3x3t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const {
|
nuclear@0
|
155 return
|
nuclear@0
|
156 std::abs(a1 - m.a1) <= epsilon &&
|
nuclear@0
|
157 std::abs(a2 - m.a2) <= epsilon &&
|
nuclear@0
|
158 std::abs(a3 - m.a3) <= epsilon &&
|
nuclear@0
|
159 std::abs(b1 - m.b1) <= epsilon &&
|
nuclear@0
|
160 std::abs(b2 - m.b2) <= epsilon &&
|
nuclear@0
|
161 std::abs(b3 - m.b3) <= epsilon &&
|
nuclear@0
|
162 std::abs(c1 - m.c1) <= epsilon &&
|
nuclear@0
|
163 std::abs(c2 - m.c2) <= epsilon &&
|
nuclear@0
|
164 std::abs(c3 - m.c3) <= epsilon;
|
nuclear@0
|
165 }
|
nuclear@0
|
166
|
nuclear@0
|
167 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
168 template <typename TReal>
|
nuclear@0
|
169 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose()
|
nuclear@0
|
170 {
|
nuclear@0
|
171 // (TReal&) don't remove, GCC complains cause of packed fields
|
nuclear@0
|
172 std::swap( (TReal&)a2, (TReal&)b1);
|
nuclear@0
|
173 std::swap( (TReal&)a3, (TReal&)c1);
|
nuclear@0
|
174 std::swap( (TReal&)b3, (TReal&)c2);
|
nuclear@0
|
175 return *this;
|
nuclear@0
|
176 }
|
nuclear@0
|
177
|
nuclear@0
|
178 // ----------------------------------------------------------------------------------------
|
nuclear@0
|
179 template <typename TReal>
|
nuclear@0
|
180 inline TReal aiMatrix3x3t<TReal>::Determinant() const
|
nuclear@0
|
181 {
|
nuclear@0
|
182 return a1*b2*c3 - a1*b3*c2 + a2*b3*c1 - a2*b1*c3 + a3*b1*c2 - a3*b2*c1;
|
nuclear@0
|
183 }
|
nuclear@0
|
184
|
nuclear@0
|
185 // ----------------------------------------------------------------------------------------
|
nuclear@0
|
186 template <typename TReal>
|
nuclear@0
|
187 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse()
|
nuclear@0
|
188 {
|
nuclear@0
|
189 // Compute the reciprocal determinant
|
nuclear@0
|
190 TReal det = Determinant();
|
nuclear@0
|
191 if(det == static_cast<TReal>(0.0))
|
nuclear@0
|
192 {
|
nuclear@0
|
193 // Matrix not invertible. Setting all elements to nan is not really
|
nuclear@0
|
194 // correct in a mathematical sense; but at least qnans are easy to
|
nuclear@0
|
195 // spot. XXX we might throw an exception instead, which would
|
nuclear@0
|
196 // be even much better to spot :/.
|
nuclear@0
|
197 const TReal nan = std::numeric_limits<TReal>::quiet_NaN();
|
nuclear@0
|
198 *this = aiMatrix3x3t<TReal>( nan,nan,nan,nan,nan,nan,nan,nan,nan);
|
nuclear@0
|
199
|
nuclear@0
|
200 return *this;
|
nuclear@0
|
201 }
|
nuclear@0
|
202
|
nuclear@0
|
203 TReal invdet = static_cast<TReal>(1.0) / det;
|
nuclear@0
|
204
|
nuclear@0
|
205 aiMatrix3x3t<TReal> res;
|
nuclear@0
|
206 res.a1 = invdet * (b2 * c3 - b3 * c2);
|
nuclear@0
|
207 res.a2 = -invdet * (a2 * c3 - a3 * c2);
|
nuclear@0
|
208 res.a3 = invdet * (a2 * b3 - a3 * b2);
|
nuclear@0
|
209 res.b1 = -invdet * (b1 * c3 - b3 * c1);
|
nuclear@0
|
210 res.b2 = invdet * (a1 * c3 - a3 * c1);
|
nuclear@0
|
211 res.b3 = -invdet * (a1 * b3 - a3 * b1);
|
nuclear@0
|
212 res.c1 = invdet * (b1 * c2 - b2 * c1);
|
nuclear@0
|
213 res.c2 = -invdet * (a1 * c2 - a2 * c1);
|
nuclear@0
|
214 res.c3 = invdet * (a1 * b2 - a2 * b1);
|
nuclear@0
|
215 *this = res;
|
nuclear@0
|
216
|
nuclear@0
|
217 return *this;
|
nuclear@0
|
218 }
|
nuclear@0
|
219
|
nuclear@0
|
220 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
221 template <typename TReal>
|
nuclear@0
|
222 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>& out)
|
nuclear@0
|
223 {
|
nuclear@0
|
224 out.a1 = out.b2 = std::cos(a);
|
nuclear@0
|
225 out.b1 = std::sin(a);
|
nuclear@0
|
226 out.a2 = - out.b1;
|
nuclear@0
|
227
|
nuclear@0
|
228 out.a3 = out.b3 = out.c1 = out.c2 = 0.f;
|
nuclear@0
|
229 out.c3 = 1.f;
|
nuclear@0
|
230
|
nuclear@0
|
231 return out;
|
nuclear@0
|
232 }
|
nuclear@0
|
233
|
nuclear@0
|
234 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
235 // Returns a rotation matrix for a rotation around an arbitrary axis.
|
nuclear@0
|
236 template <typename TReal>
|
nuclear@0
|
237 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t<TReal>& out)
|
nuclear@0
|
238 {
|
nuclear@0
|
239 TReal c = std::cos( a), s = std::sin( a), t = 1 - c;
|
nuclear@0
|
240 TReal x = axis.x, y = axis.y, z = axis.z;
|
nuclear@0
|
241
|
nuclear@0
|
242 // Many thanks to MathWorld and Wikipedia
|
nuclear@0
|
243 out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y;
|
nuclear@0
|
244 out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x;
|
nuclear@0
|
245 out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c;
|
nuclear@0
|
246
|
nuclear@0
|
247 return out;
|
nuclear@0
|
248 }
|
nuclear@0
|
249
|
nuclear@0
|
250 // ------------------------------------------------------------------------------------------------
|
nuclear@0
|
251 template <typename TReal>
|
nuclear@0
|
252 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<TReal>& v, aiMatrix3x3t<TReal>& out)
|
nuclear@0
|
253 {
|
nuclear@0
|
254 out = aiMatrix3x3t<TReal>();
|
nuclear@0
|
255 out.a3 = v.x;
|
nuclear@0
|
256 out.b3 = v.y;
|
nuclear@0
|
257 return out;
|
nuclear@0
|
258 }
|
nuclear@0
|
259
|
nuclear@0
|
260 // ----------------------------------------------------------------------------------------
|
nuclear@0
|
261 /** A function for creating a rotation matrix that rotates a vector called
|
nuclear@0
|
262 * "from" into another vector called "to".
|
nuclear@0
|
263 * Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
nuclear@0
|
264 * Output: mtx[3][3] -- a 3x3 matrix in colum-major form
|
nuclear@0
|
265 * Authors: Tomas Möller, John Hughes
|
nuclear@0
|
266 * "Efficiently Building a Matrix to Rotate One Vector to Another"
|
nuclear@0
|
267 * Journal of Graphics Tools, 4(4):1-4, 1999
|
nuclear@0
|
268 */
|
nuclear@0
|
269 // ----------------------------------------------------------------------------------------
|
nuclear@0
|
270 template <typename TReal>
|
nuclear@0
|
271 inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<TReal>& from,
|
nuclear@0
|
272 const aiVector3t<TReal>& to, aiMatrix3x3t<TReal>& mtx)
|
nuclear@0
|
273 {
|
nuclear@0
|
274 const TReal e = from * to;
|
nuclear@0
|
275 const TReal f = (e < 0)? -e:e;
|
nuclear@0
|
276
|
nuclear@0
|
277 if (f > static_cast<TReal>(1.0) - static_cast<TReal>(0.00001)) /* "from" and "to"-vector almost parallel */
|
nuclear@0
|
278 {
|
nuclear@0
|
279 aiVector3D u,v; /* temporary storage vectors */
|
nuclear@0
|
280 aiVector3D x; /* vector most nearly orthogonal to "from" */
|
nuclear@0
|
281
|
nuclear@0
|
282 x.x = (from.x > 0.0)? from.x : -from.x;
|
nuclear@0
|
283 x.y = (from.y > 0.0)? from.y : -from.y;
|
nuclear@0
|
284 x.z = (from.z > 0.0)? from.z : -from.z;
|
nuclear@0
|
285
|
nuclear@0
|
286 if (x.x < x.y)
|
nuclear@0
|
287 {
|
nuclear@0
|
288 if (x.x < x.z)
|
nuclear@0
|
289 {
|
nuclear@0
|
290 x.x = static_cast<TReal>(1.0);
|
nuclear@0
|
291 x.y = x.z = static_cast<TReal>(0.0);
|
nuclear@0
|
292 }
|
nuclear@0
|
293 else
|
nuclear@0
|
294 {
|
nuclear@0
|
295 x.z = static_cast<TReal>(1.0);
|
nuclear@0
|
296 x.x = x.y = static_cast<TReal>(0.0);
|
nuclear@0
|
297 }
|
nuclear@0
|
298 }
|
nuclear@0
|
299 else
|
nuclear@0
|
300 {
|
nuclear@0
|
301 if (x.y < x.z)
|
nuclear@0
|
302 {
|
nuclear@0
|
303 x.y = static_cast<TReal>(1.0);
|
nuclear@0
|
304 x.x = x.z = static_cast<TReal>(0.0);
|
nuclear@0
|
305 }
|
nuclear@0
|
306 else
|
nuclear@0
|
307 {
|
nuclear@0
|
308 x.z = static_cast<TReal>(1.0);
|
nuclear@0
|
309 x.x = x.y = static_cast<TReal>(0.0);
|
nuclear@0
|
310 }
|
nuclear@0
|
311 }
|
nuclear@0
|
312
|
nuclear@0
|
313 u.x = x.x - from.x; u.y = x.y - from.y; u.z = x.z - from.z;
|
nuclear@0
|
314 v.x = x.x - to.x; v.y = x.y - to.y; v.z = x.z - to.z;
|
nuclear@0
|
315
|
nuclear@0
|
316 const TReal c1_ = static_cast<TReal>(2.0) / (u * u);
|
nuclear@0
|
317 const TReal c2_ = static_cast<TReal>(2.0) / (v * v);
|
nuclear@0
|
318 const TReal c3_ = c1_ * c2_ * (u * v);
|
nuclear@0
|
319
|
nuclear@0
|
320 for (unsigned int i = 0; i < 3; i++)
|
nuclear@0
|
321 {
|
nuclear@0
|
322 for (unsigned int j = 0; j < 3; j++)
|
nuclear@0
|
323 {
|
nuclear@0
|
324 mtx[i][j] = - c1_ * u[i] * u[j] - c2_ * v[i] * v[j]
|
nuclear@0
|
325 + c3_ * v[i] * u[j];
|
nuclear@0
|
326 }
|
nuclear@0
|
327 mtx[i][i] += static_cast<TReal>(1.0);
|
nuclear@0
|
328 }
|
nuclear@0
|
329 }
|
nuclear@0
|
330 else /* the most common case, unless "from"="to", or "from"=-"to" */
|
nuclear@0
|
331 {
|
nuclear@0
|
332 const aiVector3D v = from ^ to;
|
nuclear@0
|
333 /* ... use this hand optimized version (9 mults less) */
|
nuclear@0
|
334 const TReal h = static_cast<TReal>(1.0)/(static_cast<TReal>(1.0) + e); /* optimization by Gottfried Chen */
|
nuclear@0
|
335 const TReal hvx = h * v.x;
|
nuclear@0
|
336 const TReal hvz = h * v.z;
|
nuclear@0
|
337 const TReal hvxy = hvx * v.y;
|
nuclear@0
|
338 const TReal hvxz = hvx * v.z;
|
nuclear@0
|
339 const TReal hvyz = hvz * v.y;
|
nuclear@0
|
340 mtx[0][0] = e + hvx * v.x;
|
nuclear@0
|
341 mtx[0][1] = hvxy - v.z;
|
nuclear@0
|
342 mtx[0][2] = hvxz + v.y;
|
nuclear@0
|
343
|
nuclear@0
|
344 mtx[1][0] = hvxy + v.z;
|
nuclear@0
|
345 mtx[1][1] = e + h * v.y * v.y;
|
nuclear@0
|
346 mtx[1][2] = hvyz - v.x;
|
nuclear@0
|
347
|
nuclear@0
|
348 mtx[2][0] = hvxz - v.y;
|
nuclear@0
|
349 mtx[2][1] = hvyz + v.x;
|
nuclear@0
|
350 mtx[2][2] = e + hvz * v.z;
|
nuclear@0
|
351 }
|
nuclear@0
|
352 return mtx;
|
nuclear@0
|
353 }
|
nuclear@0
|
354
|
nuclear@0
|
355
|
nuclear@0
|
356 #endif // __cplusplus
|
nuclear@0
|
357 #endif // AI_MATRIX3X3_INL_INC
|