本文整理汇总了C++中math::Matrix4::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4::getValue方法的具体用法?C++ Matrix4::getValue怎么用?C++ Matrix4::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类math::Matrix4
的用法示例。
在下文中一共展示了Matrix4::getValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void Frustum::setup(const Math::Matrix4 &matrix) {
// Based on "Fast Extraction of Viewing Frustum Planes from the
// World-View-Projection matrix" by Gil Gribb and Klaus Hartmann.
// http://www.cs.otago.ac.nz/postgrads/alexis/planeExtraction.pdf
_planes[0]._normal.x() = matrix.getValue(3, 0) + matrix.getValue(0, 0);
_planes[0]._normal.y() = matrix.getValue(3, 1) + matrix.getValue(0, 1);
_planes[0]._normal.z() = matrix.getValue(3, 2) + matrix.getValue(0, 2);
_planes[0]._d = matrix.getValue(3, 3) + matrix.getValue(0, 3);
_planes[1]._normal.x() = matrix.getValue(3, 0) - matrix.getValue(0, 0);
_planes[1]._normal.y() = matrix.getValue(3, 1) - matrix.getValue(0, 1);
_planes[1]._normal.z() = matrix.getValue(3, 2) - matrix.getValue(0, 2);
_planes[1]._d = matrix.getValue(3, 3) - matrix.getValue(0, 3);
_planes[2]._normal.x() = matrix.getValue(3, 0) - matrix.getValue(1, 0);
_planes[2]._normal.y() = matrix.getValue(3, 1) - matrix.getValue(1, 1);
_planes[2]._normal.z() = matrix.getValue(3, 2) - matrix.getValue(1, 2);
_planes[2]._d = matrix.getValue(3, 3) - matrix.getValue(1, 3);
_planes[3]._normal.x() = matrix.getValue(3, 0) + matrix.getValue(1, 0);
_planes[3]._normal.y() = matrix.getValue(3, 1) + matrix.getValue(1, 1);
_planes[3]._normal.z() = matrix.getValue(3, 2) + matrix.getValue(1, 2);
_planes[3]._d = matrix.getValue(3, 3) + matrix.getValue(1, 3);
_planes[4]._normal.x() = matrix.getValue(3, 0) + matrix.getValue(2, 0);
_planes[4]._normal.y() = matrix.getValue(3, 1) + matrix.getValue(2, 1);
_planes[4]._normal.z() = matrix.getValue(3, 2) + matrix.getValue(2, 2);
_planes[4]._d = matrix.getValue(3, 3) + matrix.getValue(2, 3);
_planes[5]._normal.x() = matrix.getValue(3, 0) - matrix.getValue(2, 0);
_planes[5]._normal.y() = matrix.getValue(3, 1) - matrix.getValue(2, 1);
_planes[5]._normal.z() = matrix.getValue(3, 2) - matrix.getValue(2, 2);
_planes[5]._d = matrix.getValue(3, 3) - matrix.getValue(2, 3);
for (int i = 0; i < 6; ++i) {
_planes[i].normalize();
}
}