00001
00002
00003
00005
00006
00011
00016
00021
00023
00024 #ifndef MATRIX34F_H
00025 #define MATRIX34F_H
00026
00027 #include "SFVec3f.h"
00028 #include "SFPoint3f.h"
00029
00030 #include <iostream>
00031 #include <vector>
00032
00033 namespace X3DTK {
00034
00039
00040 class SFMatrix34f
00041 {
00042 public:
00044 float _11;
00046 float _21;
00048 float _31;
00049
00051 float _12;
00053 float _22;
00055 float _32;
00056
00058 float _13;
00060 float _23;
00062 float _33;
00063
00065 float _14;
00067 float _24;
00069 float _34;
00070
00072 SFMatrix34f();
00074 SFMatrix34f(float _11, float _21, float _31, float _12, float _22, float _32, float _13, float _23, float _33, float _14, float _24, float _34);
00076 explicit SFMatrix34f(const float GLMatrix[16]);
00078 SFMatrix34f(const SFVec3f &vx, const SFVec3f &vy, const SFVec3f &vz, const SFPoint3f &p);
00080 SFMatrix34f(const SFMatrix34f &m);
00081
00083 friend SFMatrix34f operator+ (const SFMatrix34f &m1, const SFMatrix34f &m2);
00085 friend SFMatrix34f operator- (const SFMatrix34f &m1, const SFMatrix34f &m2);
00087 friend SFMatrix34f operator* (const SFMatrix34f &m1, const SFMatrix34f &m2);
00089 friend SFMatrix34f operator* (const float a, const SFMatrix34f &m);
00091 friend SFVec3f operator* (const SFMatrix34f &m, const SFVec3f &v);
00093 friend SFPoint3f operator* (const SFMatrix34f &m, const SFPoint3f &v);
00095 SFMatrix34f i();
00098 SFMatrix34f iu();
00100 void toFloat16(std::vector<float> &M) const;
00101 };
00102
00104 SFMatrix34f identity34();
00106 SFMatrix34f scale34(float sx, float sy, float sz);
00108 SFMatrix34f rotationX(float angle);
00110 SFMatrix34f rotationY(float angle);
00112 SFMatrix34f rotationZ(float angle);
00114 SFMatrix34f translation(const SFVec3f &t);
00116 SFMatrix34f rotation(float angle, const SFVec3f &u);
00118 std::ostream& operator<<(std::ostream& o, const SFMatrix34f &M);
00119
00120 }
00121
00122 #endif
00123