Категория: DirectX 8
Просмотров: 7945

Следующим после класса вектора у нас на очереди идёт класс матрицы. Тоже в общем-то классический кусок кода. На нём тоже не будем сильно долго останавливаться а просто посмотрим листинг.

class CMatrix4D
{

/**
* Matrix components.
*/
float a11 , a12 , a13 , a14;
float a21 , a22 , a23 , a24;
float a31 , a32 , a33 , a34;
float a41 , a42 , a43 , a44;

public:

/**
* Default constructor.
*/
CMatrix4D( void );

/**
* Set components constructor.
*/
CMatrix4D( float a11 , float a12 , float a13 , float a14 , 
   float a21 , float a22 , float a23 , float a24 , 
   float a31 , float a32 , float a33 , float a34 , 
   float a41 , float a42 , float a43 , float a44 );

/**
* Copy constructor.
*/
CMatrix4D( const CMatrix4D & Matrix );

/**
* Assign operator.
*/
CMatrix4D operator=( const CMatrix4D & Matrix );

/**
* Assign method.
*/
void assign( const CMatrix4D & Matrix );

/**
* Multiplication operator.
*/
CVector4D operator*( const CVector4D & Vector );

/**
* Multiplication operator.
*/
CMatrix4D operator*( const CMatrix4D & Matrix );
};

Исходники.

ЗЫ если захотите немного отдохнуть от программирования, то можете почитать моё эссе про китайский и японский языки.