mirror of
https://github.com/encounter/ogws.git
synced 2026-03-30 11:33:37 -07:00
42 lines
925 B
C++
42 lines
925 B
C++
#ifndef EGG_MATH_MATRIX_H
|
|
#define EGG_MATH_MATRIX_H
|
|
#include "types_egg.h"
|
|
|
|
namespace EGG
|
|
{
|
|
struct Matrix33f
|
|
{
|
|
f32& operator()(int i, int j) { return tbl[i][j]; }
|
|
|
|
f32 tbl[3][3];
|
|
};
|
|
|
|
struct Matrix34f
|
|
{
|
|
Matrix34f() {}
|
|
Matrix34f(f32, f32, f32, f32,
|
|
f32, f32, f32, f32,
|
|
f32, f32, f32, f32);
|
|
|
|
void makeZero()
|
|
{
|
|
tbl[0][3] = tbl[0][2] = tbl[0][1] = tbl[0][0] = 0.0f;
|
|
tbl[1][3] = tbl[1][2] = tbl[1][1] = tbl[1][0] = 0.0f;
|
|
tbl[2][3] = tbl[2][2] = tbl[2][1] = tbl[2][0] = 0.0f;
|
|
}
|
|
|
|
void makeIdentity();
|
|
void makeQ(const Quatf&);
|
|
void makeS(const Vector3f&);
|
|
void setAxisRotation(const Vector3f &, f32);
|
|
void loadPosMtx(u32);
|
|
|
|
f32& operator()(int i, int j) { return tbl[i][j]; }
|
|
|
|
f32 tbl[3][4];
|
|
|
|
static Matrix34f ident;
|
|
};
|
|
}
|
|
|
|
#endif |