本文整理汇总了C++中Mat4::set方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4::set方法的具体用法?C++ Mat4::set怎么用?C++ Mat4::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4
的用法示例。
在下文中一共展示了Mat4::set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Mat4 Mat4::translated(const Vec4 &dv) const {
Mat4 m;
m.set(3, 0, dv[0]);
m.set(3, 1, dv[1]);
m.set(3, 2, dv[2]);
return m.mul(*this);
}
示例2: glLoadMatrixf
void glLoadMatrixf(const GLfloat *m)
{
if (g_modelview)
modelmat.set(m);
else
projectionmat.set(m);
}
示例3:
Mat4 Quaternion::extractMat4() const {
Mat4 result;
result.set(0, 0, 1 - 2 * this->vector[Quaternion::Y] * this->vector[Quaternion::Y] -
2 * this->vector[Quaternion::Z] * this->vector[Quaternion::Z]);
result.set(0, 1, 2 * this->vector[Quaternion::X] * this->vector[Quaternion::Y] -
2 * this->vector[Quaternion::Z] * this->vector[Quaternion::W]);
result.set(0, 2, 2 * this->vector[Quaternion::X] * this->vector[Quaternion::Y] +
2 * this->vector[Quaternion::Y] * this->vector[Quaternion::W]);
result.set(1, 0, 2 * this->vector[Quaternion::X] * this->vector[Quaternion::Y] +
2 * this->vector[Quaternion::Z] * this->vector[Quaternion::W]);
result.set(1, 1, 1 - 2 * this->vector[Quaternion::X] * this->vector[Quaternion::X] -
2 * this->vector[Quaternion::Z] * this->vector[Quaternion::Z]);
result.set(1, 2, 2 * this->vector[Quaternion::Y] * this->vector[Quaternion::Z] -
2 * this->vector[Quaternion::X] * this->vector[Quaternion::W]);
result.set(2, 0, 2 * this->vector[Quaternion::X] * this->vector[Quaternion::Z] -
2 * this->vector[Quaternion::Y] * this->vector[Quaternion::W]);
result.set(2, 1, 2 * this->vector[Quaternion::Y] * this->vector[Quaternion::Z] +
2 * this->vector[Quaternion::X] * this->vector[Quaternion::W]);
result.set(2, 2, 1 - 2 * this->vector[Quaternion::X] * this->vector[Quaternion::X] -
2 * this->vector[Quaternion::Y] * this->vector[Quaternion::Y]);
return result;
}
示例4: get
Mat4 Mat4::transpose() const {
Mat4 ret;
for(int i = 0; i < 4; i++) {
for(int j = 0; j < 4; j++) {
ret.set(i, j, get(j, i));
}
}
return ret;
}
示例5: get
Mat4 Mat4::transpose() const
{
Mat4 result;
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
result.set(j, i, get(i, j));
}
}
return result;
}