Subversion Repositories gelsvn

Rev

Rev 2 | Rev 89 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 bj 1
#ifndef __CGLA_MAT3X3F_H__
2
#define __CGLA_MAT3X3F_H__
3
 
4
#include "CGLA.h"
5
#include "Vec3f.h"
6
#include "ArithSqMat3x3Float.h"
7
 
12 jab 8
namespace CGLA 
9
{
2 bj 10
 
12 jab 11
  /** 3 by 3 float matrix.
12
      This class will typically be used for rotation or
13
      scaling matrices for 3D vectors. */
14
  class Mat3x3f: public ArithSqMat3x3Float<Vec3f, Mat3x3f>
15
    {
16
    public:
2 bj 17
 
12 jab 18
      /// Construct matrix from 3 Vec3f vectors.
19
      Mat3x3f(Vec3f _a, Vec3f _b, Vec3f _c): 
20
	ArithSqMat3x3Float<Vec3f, Mat3x3f> (_a,_b,_c) {}
2 bj 21
 
12 jab 22
      /// Construct the 0 matrix
23
      Mat3x3f() {}
2 bj 24
 
12 jab 25
      /// Construct a matrix from a single scalar value.
26
      explicit Mat3x3f(float a): ArithSqMat3x3Float<Vec3f, Mat3x3f>(a) {}
2 bj 27
 
12 jab 28
    };
2 bj 29
 
12 jab 30
  /// Create a rotation _matrix. Rotates about one of the major axes.
31
  Mat3x3f rotation_Mat3x3f(CGLA::Axis axis, float angle);
2 bj 32
 
12 jab 33
  /// Create a scaling matrix.
34
  Mat3x3f scaling_Mat3x3f(const Vec3f&);
2 bj 35
 
12 jab 36
  /// Create an identity matrix.
37
  inline Mat3x3f identity_Mat3x3f()
38
    {
39
      return Mat3x3f(Vec3f(1,0,0), Vec3f(0,1,0), Vec3f(0,0,1));
40
    }
2 bj 41
 
42
}
43
#endif
44
 
45
 
46
 
47
 
48
 
49
 
50