source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/linear/Matrix3f.h @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.2 KB
Line 
1/*
2
3Brian Curless
4
5Computer Graphics Laboratory
6Stanford University
7
8---------------------------------------------------------------------
9
10Copyright (1997) The Board of Trustees of the Leland Stanford Junior
11University. Except for commercial resale, lease, license or other
12commercial transactions, permission is hereby given to use, copy,
13modify this software for academic purposes only.  No part of this
14software or any derivatives thereof may be used in the production of
15computer models for resale or for use in a commercial
16product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
17CONCERNING THIS SOFTWARE.  No support is implied or provided.
18
19*/
20
21
22#ifndef _MATRIX3F_
23#define _MATRIX3F_
24
25#include "Vec3f.h"
26#include "defines.h"
27
28class Matrix3f {
29    friend class Vec3f;
30
31 public:
32    float m[3][3];
33
34    Matrix3f() {}
35    Matrix3f(const Matrix3f &a) {setValue(a);}
36    Matrix3f(float a[][3]) {setValue(a);}
37    Matrix3f(float *a0, float *a1, float *a2) {setValue(a0, a1, a2);}
38    Matrix3f(Vec3f a0, Vec3f a1, Vec3f a2) {setValue(a0, a1, a2);}
39    Matrix3f(float a00, float a01, float a02,
40                  float a10, float a11, float a12,
41                  float a20, float a21, float a22)
42        { setValue(a00, a01, a02, a10, a11, a12, a20, a21, a22); }
43    void clear() {setValue(0,0,0,0,0,0,0,0,0);}
44    void makeIdentity();
45    void setValue(const Matrix3f &a);
46    void setValue(float a[][3]);
47    void setValue(float *a0, float *a1, float *a2);
48    void setValue(Vec3f a0, Vec3f a1, Vec3f a2);
49    void setValue(float a00, float a01, float a02,
50                  float a10, float a11, float a12,
51                  float a20, float a21, float a22);
52    Vec3f mult(Vec3f &vec);
53    float elem(int i, int j) {return m[i][j];}
54    void setElem(int i, int j, float val) {m[i][j] = val;}
55    Matrix3f&     operator +=(const Matrix3f &a);
56    float determinant();
57    int operator==(const Matrix3f &);
58    int operator!=(const Matrix3f &);
59    Matrix3f & operator*=(float);
60    Matrix3f inverse() const;
61    void map(const Vec3f vin[3], const Vec3f vout[3]);
62    void toNR(Matrix3f &in, float **nrmat) const;
63    void setScale(float s);
64    void setScale(float sx, float sy, float sz);
65    void setScale(const Vec3f &s);
66    Matrix3f & multLeft(const Matrix3f &m);
67};
68
69#endif
Note: See TracBrowser for help on using the repository browser.