1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#ifndef __MATRIX4x4_h
#define __MATRIX4x4_h
//#include "Vec4f.h"
//class Vec4f;
class Matrix4x4 {
public:
inline Matrix4x4 ();
inline void setIdentity ();
inline void setTranslation (const Vec3f& translation_values);
inline void setRotation (const Vec3f& rotation_values);
inline void lookAt (const Vec3f& camera_origin, const Vec3f& camera_target);
int a;
private:
Vec4f row1, row2, row3, row4;
};
inline Matrix4x4::Matrix4x4 () {
row1 = Vec4f (0.0f,0.0f,0.0f,0.0f);
row2 = Vec4f (0.0f,0.0f,0.0f,0.0f);
row3 = Vec4f (0.0f,0.0f,0.0f,0.0f);
row4 = Vec4f (0.0f,0.0f,0.0f,0.0f);
a=5;
}
inline void Matrix4x4::setIdentity () {
row1 = Vec4f (1.0f,0.0f,0.0f,0.0f);
row2 = Vec4f (0.0f,1.0f,0.0f,0.0f);
row3 = Vec4f (0.0f,0.0f,1.0f,0.0f);
row4 = Vec4f (0.0f,0.0f,0.0f,1.0f);
}
inline void Matrix4x4::setTranslation (const Vec3f& translation_values) {
row1 = Vec4f (1.0f,0.0f,0.0f,translation_values.getX());
row2 = Vec4f (0.0f,1.0f,0.0f,translation_values.getY());
row3 = Vec4f (0.0f,0.0f,1.0f,translation_values.getZ());
row4 = Vec4f (0.0f,0.0f,0.0f,1.0f);
}
|