Expand description
Composable 3D transform math operating on Mat3I16 / Vec3I16.
Lives next to the type definitions because the inherent impls
belong in the same crate as the type. Higher-level GTE register
access (write_data! / write_control! macros) lives in psx-gte, which
re-exports this module so callers can keep importing it from there.
The PS1 has no hardware sin/cos – rotations use the shared
psx_math::sincos::SIN_TABLE lookup. Angles are in
256-per-revolution units (u16 with implicit wrap at 256)
rather than radians or degrees, matching the convention most PSX
homebrew uses. A full turn fits in a single byte, which indexes
every sixteenth entry of the SDK’s Q0.12 sine table.
Fixed-point conventions (inherited from the GTE):
- Matrix cells: 1.3.12 signed –
0x1000= 1.0. - Translation / screen offset / H: integers in engine-chosen scaling; the math here just passes them through.
- Vectors: 1.3.12
i16; accumulator outputs arei32in MAC ori16in IR post-saturation.
Functions§
- cos_
1_ 3_ 12 - Cosine of
anglein 256-per-revolution units, returned in 1.3.12. - sin_
1_ 3_ 12 - Sine of
anglein 256-per-revolution units, returned in 1.3.12.