00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __UT_DMatrix3_h__
00016 #define __UT_DMatrix3_h__
00017
00018 #include "UT_API.h"
00019 #include <iostream.h>
00020 #include "UT_Assert.h"
00021 #include "UT_Axis.h"
00022 #include "UT_Math.h"
00023
00024 class UT_DMatrix4;
00025 class UT_DMatrix3;
00026 class UT_Matrix3;
00027 class UT_Matrix4;
00028 class UT_XformOrder;
00029 class UT_Quaternion;
00030 class UT_Vector3;
00031
00032
00033 UT_API UT_DMatrix3 operator+(const UT_DMatrix3 &m1,const UT_DMatrix3 &m2);
00034 UT_API UT_DMatrix3 operator-(const UT_DMatrix3 &m1,const UT_DMatrix3 &m2);
00035 UT_API UT_DMatrix3 operator*(const UT_DMatrix3 &m1,const UT_DMatrix3 &m2);
00036 UT_API UT_DMatrix3 operator+(const UT_DMatrix3 &m, const UT_Vector3 &v);
00037 inline UT_DMatrix3 operator+(const UT_Vector3 &v, const UT_DMatrix3 &m);
00038 UT_API UT_DMatrix3 operator-(const UT_DMatrix3 &m, const UT_Vector3 &v);
00039 UT_API UT_DMatrix3 operator-(const UT_Vector3 &v, const UT_DMatrix3 &m);
00040 UT_API UT_DMatrix3 operator+(const UT_DMatrix3 &mat, fpreal64 sc);
00041 inline UT_DMatrix3 operator-(const UT_DMatrix3 &mat, fpreal64 sc);
00042 UT_API UT_DMatrix3 operator*(const UT_DMatrix3 &mat, fpreal64 sc);
00043 inline UT_DMatrix3 operator/(const UT_DMatrix3 &mat, fpreal64 sc);
00044 inline UT_DMatrix3 operator+(fpreal64 sc, const UT_DMatrix3 &mat);
00045 UT_API UT_DMatrix3 operator-(fpreal64 sc, const UT_DMatrix3 &mat);
00046 inline UT_DMatrix3 operator*(fpreal64 sc, const UT_DMatrix3 &mat);
00047 UT_API UT_DMatrix3 operator/(fpreal64 sc, const UT_DMatrix3 &mat);
00048
00049
00050
00051
00052
00053
00054
00055
00056 class UT_API UT_DMatrix3
00057 {
00058 public:
00059
00060 UT_DMatrix3()
00061 {
00062 }
00063
00064 explicit UT_DMatrix3(fpreal64 val)
00065 {
00066 matx[0][0] = val; matx[0][1] = 0; matx[0][2] = 0;
00067 matx[1][0] = 0; matx[1][1] = val; matx[1][2] = 0;
00068 matx[2][0] = 0; matx[2][1] = 0; matx[2][2] = val;
00069 }
00070
00071
00072 explicit UT_DMatrix3(const fpreal32 m[3][3])
00073 {
00074 matx[0][0]=m[0][0]; matx[0][1]=m[0][1]; matx[0][2]=m[0][2];
00075 matx[1][0]=m[1][0]; matx[1][1]=m[1][1]; matx[1][2]=m[1][2];
00076 matx[2][0]=m[2][0]; matx[2][1]=m[2][1]; matx[2][2]=m[2][2];
00077 }
00078 explicit UT_DMatrix3(const fpreal64 m[3][3])
00079 {
00080 matx[0][0]=m[0][0]; matx[0][1]=m[0][1]; matx[0][2]=m[0][2];
00081 matx[1][0]=m[1][0]; matx[1][1]=m[1][1]; matx[1][2]=m[1][2];
00082 matx[2][0]=m[2][0]; matx[2][1]=m[2][1]; matx[2][2]=m[2][2];
00083 }
00084
00085
00086
00087
00088 UT_DMatrix3(fpreal64 val00, fpreal64 val01, fpreal64 val02,
00089 fpreal64 val10, fpreal64 val11, fpreal64 val12,
00090 fpreal64 val20, fpreal64 val21, fpreal64 val22)
00091 {
00092 matx[0][0] = val00; matx[0][1] = val01; matx[0][2] = val02;
00093 matx[1][0] = val10; matx[1][1] = val11; matx[1][2] = val12;
00094 matx[2][0] = val20; matx[2][1] = val21; matx[2][2] = val22;
00095 }
00096
00097
00098
00099
00100
00101 explicit UT_DMatrix3(const UT_DMatrix4 &m);
00102 explicit UT_DMatrix3(const UT_Matrix3 &m);
00103
00104
00105
00106
00107
00108
00109
00110 UT_DMatrix3 &operator=(const UT_Matrix4 &m);
00111 UT_DMatrix3 &operator=(const UT_DMatrix4 &m);
00112
00113 UT_DMatrix3 &operator=(const UT_Matrix3 &m);
00114
00115 UT_DMatrix3 operator-() const
00116 {
00117 return UT_DMatrix3(-matx[0][0], -matx[0][1], -matx[0][2],
00118 -matx[1][0], -matx[1][1], -matx[1][2],
00119 -matx[2][0], -matx[2][1], -matx[2][2]);
00120 }
00121
00122
00123 void addScaledMat(fpreal64 k, const UT_DMatrix3 &m)
00124 {
00125 matx[0][0]+=k*m.matx[0][0];
00126 matx[0][1]+=k*m.matx[0][1];
00127 matx[0][2]+=k*m.matx[0][2];
00128
00129 matx[1][0]+=k*m.matx[1][0];
00130 matx[1][1]+=k*m.matx[1][1];
00131 matx[1][2]+=k*m.matx[1][2];
00132
00133 matx[2][0]+=k*m.matx[2][0];
00134 matx[2][1]+=k*m.matx[2][1];
00135 matx[2][2]+=k*m.matx[2][2];
00136 }
00137 inline
00138 UT_DMatrix3 &operator+=(const UT_DMatrix3 &m)
00139 {
00140 matx[0][0]+=m.matx[0][0];
00141 matx[0][1]+=m.matx[0][1];
00142 matx[0][2]+=m.matx[0][2];
00143
00144 matx[1][0]+=m.matx[1][0];
00145 matx[1][1]+=m.matx[1][1];
00146 matx[1][2]+=m.matx[1][2];
00147
00148 matx[2][0]+=m.matx[2][0];
00149 matx[2][1]+=m.matx[2][1];
00150 matx[2][2]+=m.matx[2][2];
00151 return *this;
00152 }
00153 inline
00154 UT_DMatrix3 &operator-=(const UT_DMatrix3 &m)
00155 {
00156 matx[0][0]-=m.matx[0][0];
00157 matx[0][1]-=m.matx[0][1];
00158 matx[0][2]-=m.matx[0][2];
00159
00160 matx[1][0]-=m.matx[1][0];
00161 matx[1][1]-=m.matx[1][1];
00162 matx[1][2]-=m.matx[1][2];
00163
00164 matx[2][0]-=m.matx[2][0];
00165 matx[2][1]-=m.matx[2][1];
00166 matx[2][2]-=m.matx[2][2];
00167 return *this;
00168 }
00169 UT_DMatrix3 &operator*=(const UT_DMatrix3 &m);
00170 UT_DMatrix3 &operator*=(const UT_Matrix3 &m);
00171
00172 void multiply3(const UT_Matrix4 &m);
00173 void multiply3(const UT_DMatrix4 &m);
00174
00175 unsigned operator==(const UT_DMatrix3 &m) const;
00176 unsigned operator!=(const UT_DMatrix3 &m) const
00177 {
00178 return !(*this == m);
00179 }
00180
00181
00182 UT_DMatrix3 &operator= (fpreal64 val)
00183 {
00184 matx[0][0] = val; matx[0][1] = 0; matx[0][2] = 0;
00185 matx[1][0] = 0; matx[1][1] = val; matx[1][2] = 0;
00186 matx[2][0] = 0; matx[2][1] = 0; matx[2][2] = val;
00187 return *this;
00188 }
00189 UT_DMatrix3 &operator*=(fpreal64 scalar)
00190 {
00191 matx[0][0]*=scalar; matx[0][1]*=scalar; matx[0][2]*=scalar;
00192 matx[1][0]*=scalar; matx[1][1]*=scalar; matx[1][2]*=scalar;
00193 matx[2][0]*=scalar; matx[2][1]*=scalar; matx[2][2]*=scalar;
00194 return *this;
00195 }
00196 UT_DMatrix3 &operator/=(fpreal64 scalar)
00197 {
00198 return operator*=( 1/scalar );
00199 }
00200
00201
00202 unsigned isEqual( const UT_DMatrix3 &m,
00203 fpreal64 tolerance=UT_DTOLERANCE ) const
00204 {
00205 return (&m == this) ? 1U : (
00206 UTisEqual( matx[0][0], m.matx[0][0], tolerance ) &&
00207 UTisEqual( matx[0][1], m.matx[0][1], tolerance ) &&
00208 UTisEqual( matx[0][2], m.matx[0][2], tolerance ) &&
00209
00210 UTisEqual( matx[1][0], m.matx[1][0], tolerance ) &&
00211 UTisEqual( matx[1][1], m.matx[1][1], tolerance ) &&
00212 UTisEqual( matx[1][2], m.matx[1][2], tolerance ) &&
00213
00214 UTisEqual( matx[2][0], m.matx[2][0], tolerance ) &&
00215 UTisEqual( matx[2][1], m.matx[2][1], tolerance ) &&
00216 UTisEqual( matx[2][2], m.matx[2][2], tolerance ) );
00217 }
00218
00219
00220 inline
00221 UT_DMatrix3 &operator= (const UT_Vector3 &vec);
00222 inline
00223 UT_DMatrix3 &operator+=(const UT_Vector3 &vec);
00224 inline
00225 UT_DMatrix3 &operator-=(const UT_Vector3 &vec);
00226
00227
00228
00229 inline
00230 void outerproductUpdate(fpreal64 b,
00231 const UT_Vector3 &x, const UT_Vector3 &y);
00232
00233
00234
00235
00236 void arbitrary180rot();
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250 int dihedral(UT_Vector3 &a, UT_Vector3 &b,
00251 int norm=1);
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262 void lookat(const UT_Vector3 &from, const UT_Vector3 &to,
00263 fpreal64 roll = 0);
00264 void lookat(const UT_Vector3 &from, const UT_Vector3 &to,
00265 const UT_Vector3 &up);
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275 int orient(UT_Vector3 &dir, UT_Vector3 &up,
00276 int norm=1);
00277
00278
00279
00280
00281
00282
00283
00284
00285 void orient(const UT_Vector3& v,
00286 fpreal64 pscale,
00287 const UT_Vector3* pscale3,
00288 const UT_Vector3* up,
00289 const UT_Quaternion* q);
00290
00291
00292
00293
00294 fpreal64 coFactor(int k, int l) const;
00295
00296 fpreal64 determinant() const
00297 {
00298 return(matx[0][0]*
00299 (matx[1][1]*matx[2][2]-matx[1][2]*matx[2][1]) +
00300 matx[0][1]*
00301 (matx[1][2]*matx[2][0]-matx[1][0]*matx[2][2]) +
00302 matx[0][2]*
00303 (matx[1][0]*matx[2][1]-matx[1][1]*matx[2][0]) );
00304
00305 }
00306 fpreal64 trace() const
00307 { return matx[0][0]+matx[1][1]+matx[2][2]; }
00308
00309
00310
00311 int eigenvalues(UT_Vector3 &r, UT_Vector3 &i) const;
00312
00313
00314 int invert();
00315
00316
00317 int invert(UT_DMatrix3 &m)const;
00318 int invertKramer(void);
00319 int invertKramer(UT_DMatrix3 &m)const;
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329 int safeInvertSymmetric(fpreal64 tol=1e-6f);
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340 bool diagonalizeSymmetric(UT_DMatrix3 &R, UT_DMatrix3 &D, fpreal64 tol=1e-6f) const;
00341
00342
00343
00344
00345
00346 void splitRotationScale(UT_DMatrix3 &R, UT_DMatrix3 &S, fpreal64 tol=1e-6f) const;
00347
00348
00349 void transpose(void)
00350 {
00351 fpreal64 tmp;
00352 tmp=matx[0][1]; matx[0][1]=matx[1][0]; matx[1][0]=tmp;
00353 tmp=matx[0][2]; matx[0][2]=matx[2][0]; matx[2][0]=tmp;
00354 tmp=matx[1][2]; matx[1][2]=matx[2][1]; matx[2][1]=tmp;
00355 }
00356 UT_DMatrix3 transpose(void) const;
00357
00358 bool isSymmetric(fpreal64 tolerance = UT_FTOLERANCE) const;
00359
00360
00361
00362
00363
00364
00365 void rotate(UT_Vector3 &axis, fpreal64 theta, int norm=1);
00366 UT_DMatrix3 rotate(UT_Vector3 &axis, fpreal64 theta, int norm=1) const;
00367 static UT_DMatrix3 rotationMat(UT_Vector3 &axis, fpreal64 theta, int norm=1);
00368 void rotate(UT_Axis3::axis a, fpreal64 theta);
00369 UT_DMatrix3 rotate(UT_Axis3::axis a, fpreal64 theta) const;
00370 static UT_DMatrix3 rotationMat(UT_Axis3::axis a, fpreal64 theta);
00371
00372
00373 void prerotate(UT_Vector3 &axis, fpreal64 theta, int norm=1);
00374 UT_DMatrix3 prerotate(UT_Vector3 &axis, fpreal64 theta, int norm=1) const;
00375 void prerotate(UT_Axis3::axis a, fpreal64 theta);
00376 UT_DMatrix3 prerotate(UT_Axis3::axis a, fpreal64 theta) const;
00377
00378
00379
00380 void prerotate(fpreal64 rx, fpreal64 ry, fpreal64 rz,
00381 const UT_XformOrder &order);
00382 UT_DMatrix3 prerotate(fpreal64 rx, fpreal64 ry, fpreal64 rz,
00383 const UT_XformOrder &order) const;
00384
00385
00386
00387
00388 void rotate(fpreal64 rx, fpreal64 ry, fpreal64 rz, const UT_XformOrder &ord);
00389 UT_DMatrix3 rotate(fpreal64 rx, fpreal64 ry, fpreal64 rz,
00390 const UT_XformOrder &ord) const;
00391
00392
00393 void scale(fpreal64 sx, fpreal64 sy, fpreal64 sz)
00394 {
00395 matx[0][0] *= sx; matx[0][1] *= sy; matx[0][2] *= sz;
00396 matx[1][0] *= sx; matx[1][1] *= sy; matx[1][2] *= sz;
00397 matx[2][0] *= sx; matx[2][1] *= sy; matx[2][2] *= sz;
00398 }
00399 UT_DMatrix3 scale(fpreal64 sx, fpreal64 sy, fpreal64 sz) const;
00400
00401
00402 void prescale(fpreal64 sx, fpreal64 sy, fpreal64 sz)
00403 {
00404 matx[0][0] *= sx; matx[1][0] *= sy; matx[2][0] *= sz;
00405 matx[0][1] *= sx; matx[1][1] *= sy; matx[2][1] *= sz;
00406 matx[0][2] *= sx; matx[1][2] *= sy; matx[2][2] *= sz;
00407 }
00408 UT_DMatrix3 prescale(fpreal64 sx, fpreal64 sy, fpreal64 sz) const;
00409
00410
00411 void translate(fpreal64 dx, fpreal64 dy)
00412 {
00413 matx[0][0] += matx[0][2] * dx;
00414 matx[0][1] += matx[0][2] * dy;
00415 matx[1][0] += matx[1][2] * dx;
00416 matx[1][1] += matx[1][2] * dy;
00417 matx[2][0] += matx[2][2] * dx;
00418 matx[2][1] += matx[2][2] * dy;
00419 }
00420 UT_DMatrix3 translate(fpreal64 dx, fpreal64 dy) const;
00421
00422
00423 void pretranslate(fpreal64 dx, fpreal64 dy)
00424 {
00425 matx[2][0] += matx[0][0] * dx + matx[1][0] * dy;
00426 matx[2][1] += matx[0][1] * dx + matx[1][1] * dy;
00427 matx[2][2] += matx[0][2] * dx + matx[1][2] * dy;
00428 }
00429 UT_DMatrix3 pretranslate(fpreal64 dx, fpreal64 dy) const;
00430
00431
00432
00433
00434
00435
00436 int crack(UT_Vector3 &rvec, const UT_XformOrder &order,
00437 int remove_scales=1);
00438 int crack(UT_Vector3 &rvec, const UT_XformOrder &order,
00439 int remove_scales=1) const;
00440
00441
00442
00443
00444
00445 void conditionRotate(UT_Vector3 *scales = 0);
00446
00447
00448
00449
00450 void extractScales(UT_Vector3 &scales, UT_Vector3 *shears=0);
00451
00452
00453
00454 void shearXY(fpreal64 val);
00455 void shearXZ(fpreal64 val);
00456 void shearYZ(fpreal64 val);
00457
00458
00459 void shear(fpreal64 s_xy, fpreal64 s_xz, fpreal64 s_yz)
00460 {
00461 matx[0][0] += matx[0][1]*s_xy + matx[0][2]*s_xz;
00462 matx[0][1] += matx[0][2]*s_yz;
00463
00464 matx[1][0] += matx[1][1]*s_xy + matx[1][2]*s_xz;
00465 matx[1][1] += matx[1][2]*s_yz;
00466
00467 matx[2][0] += matx[2][1]*s_xy + matx[2][2]*s_xz;
00468 matx[2][1] += matx[2][2]*s_yz;
00469 }
00470
00471
00472
00473
00474 int solve(fpreal64 cx, fpreal64 cy, fpreal64 cz, UT_Vector3 &result) const;
00475
00476
00477
00478
00479
00480
00481
00482 void changeSpace(UT_Vector3 &iSrc, UT_Vector3 &jSrc,
00483 UT_Vector3 &iDest,UT_Vector3 &jDest,
00484 int norm=1);
00485 UT_DMatrix3 changeSpace(UT_Vector3 &iSrc, UT_Vector3 &jSrc,
00486 UT_Vector3 &iDest,UT_Vector3 &jDest,
00487 int norm=1) const;
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497 void xform(const UT_XformOrder &order,
00498 fpreal64 tx=0., fpreal64 ty=0., fpreal64 rz=0.,
00499 fpreal64 sx=1., fpreal64 sy=1., fpreal64 px=0., fpreal64 py=0.,
00500 int reverse=0);
00501 UT_DMatrix3 xform(const UT_XformOrder &order,
00502 fpreal64 tx=0., fpreal64 ty=0., fpreal64 rz=0.,
00503 fpreal64 sx=1., fpreal64 sy=1., fpreal64 px=0., fpreal64 py=0.,
00504 int reverse=0) const;
00505
00506
00507 void xform(const UT_XformOrder &order,
00508 fpreal64 tx, fpreal64 ty, fpreal64 rz,
00509 fpreal64 sx, fpreal64 sy, fpreal64 s_xy,
00510 fpreal64 px, fpreal64 py,
00511 int reverse=0);
00512
00513
00514
00515
00516
00517 void stretch(UT_Vector3 &v, fpreal64 amount, int norm=1);
00518 UT_DMatrix3 stretch(UT_Vector3 &v, fpreal64 amount, int norm=1) const;
00519
00520
00521
00522 int isNormalized() const;
00523
00524
00525 fpreal64 dot(unsigned i, unsigned j) const
00526 {
00527 return (i <= 2 && j <= 2) ?
00528 matx[i][0]*matx[j][0] + matx[i][1]*matx[j][1] +
00529 matx[i][2]*matx[j][2] : 0;
00530 }
00531
00532
00533 void identity() { *this = 1; }
00534
00535 void zero() { *this = 0; }
00536
00537
00538
00539 inline
00540 fpreal64 &operator()(unsigned row, unsigned col)
00541 {
00542 UT_ASSERT_P(row < 3 && col < 3);
00543 return matx[row][col];
00544 }
00545 inline
00546 fpreal64 operator()(unsigned row, unsigned col) const
00547 {
00548 UT_ASSERT_P(row < 3 && col < 3);
00549 return matx[row][col];
00550 }
00551
00552
00553
00554
00555 fpreal64 *operator()(unsigned row)
00556 {
00557 UT_ASSERT_P(row < 3);
00558 return matx[row];
00559 }
00560 const fpreal64*operator()(unsigned row) const
00561 {
00562 UT_ASSERT_P(row < 3);
00563 return matx[row];
00564 }
00565
00566
00567
00568
00569 fpreal64 getEuclideanNorm() const
00570 { return SYSsqrt(getEuclideanNorm2()); }
00571
00572 fpreal64 getEuclideanNorm2() const;
00573
00574
00575
00576 int save(ostream &os, int binary) const;
00577 void outAsciiNoName(ostream &os) const;
00578
00579 static const UT_DMatrix3 &getIdentityMatrix();
00580
00581
00582 friend ostream &operator<<(ostream &os, const UT_DMatrix3 &v)
00583 {
00584 os << className() << ' ';
00585 v.outAsciiNoName(os);
00586 return os;
00587 }
00588 int isIdentity() const
00589 {
00590
00591 return(
00592 matx[0][0]==1.0 && matx[0][1]==0.0
00593 && matx[0][2]==0.0 &&
00594 matx[1][0]==0.0 && matx[1][1]==1.0
00595 && matx[1][2]==0.0 &&
00596 matx[2][0]==0.0 && matx[2][1]==0.0
00597 && matx[2][2]==1.0
00598 );
00599 }
00600
00601
00602 const fpreal64 *data(void) const { return (const fpreal64 *)&matx[0][0];}
00603 fpreal64 *data(void) { return (fpreal64 *)&matx[0][0]; }
00604
00605
00606 int isZero() const
00607 {
00608
00609 return(
00610 matx[0][0]==0.0 && matx[0][1]==0.0
00611 && matx[0][2]==0.0 &&
00612 matx[1][0]==0.0 && matx[1][1]==0.0
00613 && matx[1][2]==0.0 &&
00614 matx[2][0]==0.0 && matx[2][1]==0.0
00615 && matx[2][2]==0.0
00616 );
00617 }
00618 private:
00619
00620
00621
00622 int checkRot() const;
00623 void permute(int l0, int l1, int l2);
00624
00625 static const char *className(void);
00626
00627
00628 fpreal64 matx[3][3];
00629 };
00630
00631 #include "UT_Vector3.h"
00632
00633 inline
00634 UT_DMatrix3 &UT_DMatrix3::operator=(const UT_Vector3 &vec)
00635 {
00636 matx[0][0] = matx[0][1] = matx[0][2] = vec.x();
00637 matx[1][0] = matx[1][1] = matx[1][2] = vec.y();
00638 matx[2][0] = matx[2][1] = matx[2][2] = vec.z();
00639 return *this;
00640 }
00641
00642 inline
00643 UT_DMatrix3 &UT_DMatrix3::operator+=(const UT_Vector3 &vec)
00644 {
00645 fpreal64 x = vec.x(); fpreal64 y = vec.y(); fpreal64 z = vec.z();
00646 matx[0][0]+=x; matx[0][1]+=x; matx[0][2]+=x;
00647 matx[1][0]+=y; matx[1][1]+=y; matx[1][2]+=y;
00648 matx[2][0]+=z; matx[2][1]+=z; matx[2][2]+=z;
00649 return *this;
00650 }
00651
00652 inline
00653 UT_DMatrix3 &UT_DMatrix3::operator-=(const UT_Vector3 &vec)
00654 {
00655 fpreal64 x = vec.x(); fpreal64 y = vec.y(); fpreal64 z = vec.z();
00656 matx[0][0]-=x; matx[0][1]-=x; matx[0][2]-=x;
00657 matx[1][0]-=y; matx[1][1]-=y; matx[1][2]-=y;
00658 matx[2][0]-=z; matx[2][1]-=z; matx[2][2]-=z;
00659 return *this;
00660 }
00661
00662 inline
00663 void UT_DMatrix3::outerproductUpdate(fpreal64 b,
00664 const UT_Vector3 &x,
00665 const UT_Vector3 &y)
00666 {
00667 fpreal64 bx;
00668 bx = b * x(0);
00669 matx[0][0]+=bx*y(0);matx[0][1]+=bx*y(1);matx[0][2]+=bx*y(2);
00670 bx = b * x(1);
00671 matx[1][0]+=bx*y(0);matx[1][1]+=bx*y(1);matx[1][2]+=bx*y(2);
00672 bx = b * x(2);
00673 matx[2][0]+=bx*y(0);matx[2][1]+=bx*y(1);matx[2][2]+=bx*y(2);
00674 }
00675
00676
00677
00678 inline
00679 UT_DMatrix3 operator+(const UT_Vector3 &vec, const UT_DMatrix3 &mat)
00680 {
00681 return mat+vec;
00682 }
00683
00684 inline
00685 UT_DMatrix3 operator*(fpreal64 sc, const UT_DMatrix3 &m1)
00686 {
00687 return m1*sc;
00688 }
00689
00690 inline
00691 UT_DMatrix3 operator/(const UT_DMatrix3 &m1, fpreal64 scalar)
00692 {
00693 return (m1 * (1/scalar));
00694 }
00695
00696
00697 #endif