Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Движение луча света по поверхности Безье / bezier / Matrix
.h
/*
File: Matrix.h
Author: Thomas Mшlhave (AKA Thoooms)
Info: This file contains the prototypes and so on for my matrix class
*/
#ifndef __MAT4X4_H_INCLUDED__
#define __MAT4X4_H_INCLUDED__
const float TM_PI = 3.141592654f;
const float TM_PI_DIV_180 = TM_PI/180.0f;
class Matrix4x4
{
private:
public:
float M[4][4]; //should be made private
void InsertVertex (unsigned int row, unsigned int col, float* num);
float GetElement (unsigned int row, unsigned int column);
void ZeroOutMatrix (void);
void MultiplyWithScalar(float num);
void MakeIdentityMatrix_4x4 (void);
Matrix4x4 MultiplyWith4x4(Matrix4x4* a);
};
class Matrix4x1
{
private:
public:
/* To avoid the below temp vars I should derive a "point" class" */
int params; //temp! Needed for compatibility with 3dclass
bool active; //temp! Needed for compatibility with 3dclass
float M[4]; //should be made private
Matrix4x1(); //standard constructor
Matrix4x1(float x, float y, float z, float w); //constructor that uses values
void InsertVertex (unsigned int row, float* num);
Matrix4x1 MultiplyWith4x4 (Matrix4x4 *a);
void DivideWith_W (void);
void ProjectPerspective(float distance_from_screen); // returns the projektet coordinate
void Translate(float dx, float dy, float dz);
void Scale(float sx, float sy, float sz);
float GetLenght();
void MultiplyWithScalar(float num);
Matrix4x1 CrossProduct(Matrix4x1* a);
Matrix4x1 XRotate(float Angle);
Matrix4x1 YRotate(float Angle);
Matrix4x1 ZRotate(float Angle);
};
#endif __MAT4X4_H_INCLUDED__