mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Polish
This commit is contained in:
parent
513532a93c
commit
f7067644a3
8 changed files with 107 additions and 92 deletions
|
@ -1663,14 +1663,16 @@ inline void CMatrix4<T>::getTransposed(CMatrix4<T> &o) const
|
|||
template <class T>
|
||||
std::ostream& operator<<(std::ostream& os, const CMatrix4<T>& matrix)
|
||||
{
|
||||
for (int row = 0; row < 4; ++row) {
|
||||
os << "(\n";
|
||||
for (int row = 0; row < 4; ++row) {
|
||||
for (int col = 0; col < 4; ++col) {
|
||||
os << "\t";
|
||||
os << matrix(row, col);
|
||||
}
|
||||
os << "\n";
|
||||
}
|
||||
return os;
|
||||
os << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
// used to scale <-1,-1><1,1> to viewport
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include "matrix4.h"
|
||||
#include "vector3d.h"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
// NOTE: You *only* need this when updating an application from Irrlicht before 1.8 to Irrlicht 1.8 or later.
|
||||
// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions changed.
|
||||
// Before the fix they had mixed left- and right-handed rotations.
|
||||
|
@ -215,6 +217,12 @@ public:
|
|||
f32 W; // real part
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const quaternion& q)
|
||||
{
|
||||
os << q.X << "\t" << q.Y << "\t" << q.Z << "\t" << q.W;
|
||||
return os;
|
||||
}
|
||||
|
||||
// Constructor which converts Euler angles to a quaternion
|
||||
inline quaternion::quaternion(f32 x, f32 y, f32 z)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue