如何在 OGRE 中访问 Matrix4 的各个元素

How to access individual elements of Matrix4 in OGRE

如何访问 Ogre::Matrix4 的各个元素?我看到了 OGRE 1.9 的 API,但我找不到单独访问每个矩阵元素的方法。我想使用行号、列号访问它们。

Ogre::Matrix4::operator[](size_t iRow) 看起来最接近我的需要,但我无法弄清楚它的用途或使用方法。

也发布在 OGRE::help forum

就像访问数组一样访问它(在内部 it is)。

Ogre::Matrix4 mat;
mat[0][0] = mat[3][3] = 1.5f;
Ogre::Real r1 = mat[0][0]; // First element
Ogre::Real r2 = mat[3][3]; // Last element