本文整理汇总了C++中Matrix44f::multiply方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix44f::multiply方法的具体用法?C++ Matrix44f::multiply怎么用?C++ Matrix44f::multiply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix44f
的用法示例。
在下文中一共展示了Matrix44f::multiply方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCameraTransformationMatrix
/** Get a reversed transformation matrix to be used for cameras
* @param matrix place to place matrix in
*/
void Position::getCameraTransformationMatrix(Matrix44f& matrix)
{
// z is reversed
Vector3f z(-forward.getX(), -forward.getY(), -forward.getZ());
// get x vector
Vector3f x;
x.crossProduct(up, z);
// matrix is transposed (rows instead of columns)
#define MAGIC3D_A(row,col) matrix.data[col*4+row]
MAGIC3D_A(0, 0) = x.data[0];
MAGIC3D_A(0, 1) = x.data[1];
MAGIC3D_A(0, 2) = x.data[2];
MAGIC3D_A(0, 3) = 0.0;
MAGIC3D_A(1, 0) = up.data[0];
MAGIC3D_A(1, 1) = up.data[1];
MAGIC3D_A(1, 2) = up.data[2];
MAGIC3D_A(1, 3) = 0.0;
MAGIC3D_A(2, 0) = z.data[0];
MAGIC3D_A(2, 1) = z.data[1];
MAGIC3D_A(2, 2) = z.data[2];
MAGIC3D_A(2, 3) = 0.0;
MAGIC3D_A(3, 0) = 0.0;
MAGIC3D_A(3, 1) = 0.0;
MAGIC3D_A(3, 2) = 0.0;
MAGIC3D_A(3, 3) = 1.0;
#undef MAGIC3D_A
// apply reversed translation
Matrix44f trans;
trans.createTranslationMatrix(-location.getX(), -location.getY(), -location.getZ());
matrix.multiply(trans);
}