Ejemplo n.º 1
0
const Vertex Matrix3D::operator*(const Vertex &p) const
{
	/*
		Multiplying a vertex by a matrix
	*/

	// Need to update this

	Vertex temp;

	temp.SetX((this->_m[0][0]  * p.GetX()) + (this->_m[0][1]  * p.GetY()) + (this->_m[0][2] * p.GetZ()) + (this->_m[0][3] * p.GetW()));
	temp.SetY((this->_m[1][0]  * p.GetX()) + (this->_m[1][1]  * p.GetY()) + (this->_m[1][2] * p.GetZ()) + (this->_m[1][3] * p.GetW()));
	temp.SetZ((this->_m[2][0]  * p.GetX()) + (this->_m[2][1]  * p.GetY()) + (this->_m[2][2] * p.GetZ()) + (this->_m[2][3] * p.GetW()));
	temp.SetW((this->_m[3][0]  * p.GetX()) + (this->_m[3][1]  * p.GetY()) + (this->_m[3][2] * p.GetZ()) + (this->_m[3][3] * p.GetW()));

	temp.GetColor().SetValue(p.GetColor().GetValue());

	return temp;

}