mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Refactor matrix4.h
Sets the surprising row-major conventions used here straight. Renames rotateVect to rotateAndScaleVect: If the matrix also scales, that is applied as well by the method. Obsolete rotateVect variants are removed. The inverseRotateVect method is also renamed accordingly. Note that this applies the transpose of the product of the scale and rotation matrices, which inverts just the rotation.
This commit is contained in:
parent
c8f1efebea
commit
7e4919c6ed
11 changed files with 46 additions and 68 deletions
|
@ -225,8 +225,7 @@ void GUIScene::setCameraRotation(v3f rot)
|
|||
core::matrix4 mat;
|
||||
mat.setRotationDegrees(rot);
|
||||
|
||||
m_cam_pos = v3f(0.f, 0.f, m_cam_distance);
|
||||
mat.rotateVect(m_cam_pos);
|
||||
m_cam_pos = mat.rotateAndScaleVect(v3f(0.f, 0.f, m_cam_distance));
|
||||
|
||||
m_cam_pos += m_target_pos;
|
||||
m_cam->setPosition(m_cam_pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue