Пример #1
-1
/**
 * Multiplication operator.  Multiplies two matrices together.
 * @param M The matrix to multiply with the current matrix.
 * @return A new matrix resulting from the product of two matrices.
 */
gmMatrix4 gmMatrix4::operator *(const gmMatrix4& M) const
{
  return gmMatrix4(RCD(*this, M, 0, 0), RCD(*this, M, 0, 1), 
		   RCD(*this, M, 0, 2), RCD(*this, M, 0, 3),
		   RCD(*this, M, 1, 0), RCD(*this, M, 1, 1),
		   RCD(*this, M, 1, 2), RCD(*this, M, 1, 3),
		   RCD(*this, M, 2, 0), RCD(*this, M, 2, 1),
		   RCD(*this, M, 2, 2), RCD(*this, M, 2, 3),
		   RCD(*this, M, 3, 0), RCD(*this, M, 3, 1),
		   RCD(*this, M, 3, 2), RCD(*this, M, 3, 3));
}
Пример #2
-1
Matrix3 Matrix3::operator *(const Matrix3& M) const {
    return
            Matrix3(RCD(*this, M, 0, 0), RCD(*this, M, 1, 0), RCD(*this, M, 2, 0),
                    RCD(*this, M, 0, 1), RCD(*this, M, 1, 1), RCD(*this, M, 2, 1),
                    RCD(*this, M, 0, 2), RCD(*this, M, 1, 2), RCD(*this, M, 2, 2));
}
Пример #3
-1
/**
 * Multiplication/assignment operator.
 * @param M The matrix to multiply with the current matrix.
 * @return The matrix *= M.
 */
gmMatrix4& gmMatrix4::operator *=(const gmMatrix4& M)
{
  assign(RCD(*this, M, 0, 0), RCD(*this, M, 0, 1), 
	 RCD(*this, M, 0, 2), RCD(*this, M, 0, 3),
	 RCD(*this, M, 1, 0), RCD(*this, M, 1, 1),
	 RCD(*this, M, 1, 2), RCD(*this, M, 1, 3),
	 RCD(*this, M, 2, 0), RCD(*this, M, 2, 1),
	 RCD(*this, M, 2, 2), RCD(*this, M, 2, 3),
	 RCD(*this, M, 3, 0), RCD(*this, M, 3, 1),
	 RCD(*this, M, 3, 2), RCD(*this, M, 3, 3));
  return *this;
}
Пример #4
-1
Matrix3& Matrix3::operator *=(const Matrix3& M) {
    assign(RCD(*this, M, 0, 0), RCD(*this, M, 1, 0), RCD(*this, M, 2, 0),
           RCD(*this, M, 0, 1), RCD(*this, M, 1, 1), RCD(*this, M, 2, 1),
           RCD(*this, M, 0, 2), RCD(*this, M, 1, 2), RCD(*this, M, 2, 2));
    return *this;
}