49typedef psyqo::FixedPoint<24>
Fixed;
67static inline psyqo::Angle phaseToAngle(
Fixed phase) {
return dcToAngle(phase.raw() >> 13); }
87static inline void matrixVertexMul2D(
const Matrix3D *m,
Vec2 *v) {
90 v->x = x *
m->vs[0].x + y *
m->vs[0].y;
91 v->y = x *
m->vs[1].x + y *
m->vs[1].y;
96template <std::
integral T>
97static inline T lerp(T
s, T d,
unsigned p) {
98 return (
s * T(256 - p) + d * T(p)) >> 8;
102 return s * (
one - p) + d * p;
106 r.
r = lerp<uint32_t>(
s.r, d.
r, p);
107 r.g = lerp<uint32_t>(
s.g, d.
g, p);
108 r.b = lerp<uint32_t>(
s.b, d.
b, p);
A trigonometry table.
Definition trigonometry.hh:74
uint32_t t
Definition cop0.c:79
uint32_t r
Definition cpu.c:222
uint32_t out
Definition cpu.c:62
one(pat, name)
Definition gentable.py:66
m
Definition gentable.py:52
FixedPoint< 10 > Angle
A fixed point angle.
Definition trigonometry.hh:48
Definition cdcheck.cpp:31
psyqo::Vector< 3, 24 > Vec3
Definition fixedmath.hh:50
void multiplyMatrix3D(const Matrix3D *m1, const Matrix3D *m2, Matrix3D *out)
Definition fixedmath.cpp:78
void generateRotationMatrix3D(Matrix3D *m, psyqo::Angle t, Axis a, const Trig &trig)
Definition fixedmath.cpp:36
void matrixVertexMul3D(const Matrix3D *m, const Vec3 *v, Vec3 *out)
Definition fixedmath.cpp:108
psyqo::Vector< 2, 24 > Vec2
Definition fixedmath.hh:51
psyqo::Trig< 24 > Trig
Definition fixedmath.hh:52
Axis
Definition fixedmath.hh:54
Fixed matrixVertexMul3Dz(const Matrix3D *m, const Vec3 *v)
Definition fixedmath.cpp:125
void matrixVertexMul3Dxy(const Matrix3D *m, const Vec3 *v, Vec2 *out)
Definition fixedmath.cpp:117
psyqo::FixedPoint< 24 > Fixed
Definition fixedmath.hh:49
void scaleMatrix3D(Matrix3D *m, Fixed s)
Definition fixedmath.cpp:100
char * s
Definition string.c:48
Definition fixedmath.hh:58
Vec3 vs[3]
Definition fixedmath.hh:59
static int c
Definition syscalls.h:122
The Color struct.
Definition common.hh:91
uint8_t g
Definition common.hh:93
uint8_t b
Definition common.hh:93
uint8_t r
Definition common.hh:93