本文整理汇总了C++中mat4::transpose方法的典型用法代码示例。如果您正苦于以下问题:C++ mat4::transpose方法的具体用法?C++ mat4::transpose怎么用?C++ mat4::transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mat4
的用法示例。
在下文中一共展示了mat4::transpose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
mat4 operator*(const mat4& value) const
{
mat4 right = value.transpose();
return mat4(
vec4(m[0].dot(right.m[0]), m[0].dot(right.m[1]),
m[0].dot(right.m[2]), m[0].dot(right.m[3])),
vec4(m[1].dot(right.m[0]), m[1].dot(right.m[1]),
m[1].dot(right.m[2]), m[1].dot(right.m[3])),
vec4(m[2].dot(right.m[0]), m[2].dot(right.m[1]),
m[2].dot(right.m[2]), m[2].dot(right.m[3])),
vec4(m[3].dot(right.m[0]), m[3].dot(right.m[1]),
m[3].dot(right.m[2]), m[3].dot(right.m[3]))
);
}
示例2:
vec4 operator*(const vec4 &v, const mat4 &a)
{
return a.transpose()*v;
}