- Field names from the 12340 type library (x/y/z/w, a0..d3, minY/minX/maxY/maxX, b/t, c/r, n/d, origin/dir) - Files renamed to match their class; CRay -> C3Ray; C3Segment, CRect, CiRect, C2iVector, C3iVector split out - MouseEventData, CharacterInfo, M2Bounds moved out of Tempest headers - 107 functions: C2/C3/C4Vector, C33/C34/C44Matrix, C4Quaternion, C4Plane, CAaBox, CAaSphere, C3Ray, CRect, CiRect, CImVector, NTempest - 0x4C1C40 is cdecl (q, out): ported as static C44Matrix::FromQuaternion (guessed) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
#ifndef ENGINE_SOURCE_TEMPEST_C33MATRIX_H
|
|
#define ENGINE_SOURCE_TEMPEST_C33MATRIX_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include "Engine/Source/Tempest/C3Vector.h"
|
|
|
|
class C44Matrix;
|
|
class C4Quaternion;
|
|
|
|
class C33Matrix {
|
|
public:
|
|
static C33Matrix Rotation(float angle);
|
|
static C33Matrix Rotation(float angle, const C3Vector& axis, bool normalized);
|
|
|
|
/* 0000 */ float a0;
|
|
/* 0004 */ float a1;
|
|
/* 0008 */ float a2;
|
|
/* 000C */ float b0;
|
|
/* 0010 */ float b1;
|
|
/* 0014 */ float b2;
|
|
/* 0018 */ float c0;
|
|
/* 001C */ float c1;
|
|
/* 0020 */ float c2;
|
|
|
|
C33Matrix() = default;
|
|
C33Matrix(const C44Matrix& m);
|
|
C33Matrix(const C4Quaternion& q);
|
|
C33Matrix Adjoint() const;
|
|
float Determinant() const;
|
|
void FromEulerAnglesZYX(float yaw, float pitch, float roll);
|
|
C33Matrix Inverse(float determinant) const;
|
|
void Rotate(float angle, const C3Vector& axis, bool normalized);
|
|
void Scale(const C3Vector& scale);
|
|
void Scale(float scale);
|
|
void Scale(float x, float y, float z);
|
|
bool ToEulerAnglesZYX(float& yaw, float& pitch, float& roll) const;
|
|
};
|
|
|
|
C33Matrix operator*(const C33Matrix& l, const C33Matrix& r);
|
|
|
|
#endif
|