Matrix4x4::Matrix4x4( const Matrix4x4& m ) { this->ID = m.ID + " copy"; this->Data = new float[ m.Dimensions * m.Dimensions ]; for ( int x = 0; x < this->Dimensions; x++ ) for ( int y = 0; y < this->Dimensions; y++ ) this->SetValue( x, y, m.GetValue( x, y ) ); }
Matrix4x4 Matrix4x4::operator*( const Matrix4x4& m ) const { Matrix4x4 temp = Matrix4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); for ( int i = 0; i < Dimensions; i++ ) for ( int j = 0; j < Dimensions; j++ ) for ( int k = 0; k < Dimensions; k++ ) temp.AddValue( i, j, this->GetValue( i, k ) * m.GetValue( k, j ) ); return temp; }