diff options
| author | Jasper St. Pierre <jstpierre@mecheye.net> | 2021-12-23 20:56:02 -0800 |
|---|---|---|
| committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2021-12-23 20:56:02 -0800 |
| commit | 32d021a88949400915d92c10171a6b541a3c70fd (patch) | |
| tree | 748ee4e76ca5858ef7fd8ad06232025691b53aea /include/JSystem/JMath | |
| parent | 045fefcab74887e74eb6e6b462f9c50a09486ea9 (diff) | |
JPAExtraShape
Diffstat (limited to 'include/JSystem/JMath')
| -rw-r--r-- | include/JSystem/JMath/JMATrigonometric.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/JSystem/JMath/JMATrigonometric.h b/include/JSystem/JMath/JMATrigonometric.h index 79d3798ed2..a01b717ca8 100644 --- a/include/JSystem/JMath/JMATrigonometric.h +++ b/include/JSystem/JMath/JMATrigonometric.h @@ -17,6 +17,9 @@ struct pair { struct TSinCosTable { std::pair<f32, f32> table[0x2000]; + + f32 sinShort(s16 v) const { return table[static_cast<u16>(v) >> 3].a1; } + f32 cosShort(s16 v) const { return table[static_cast<u16>(v) >> 3].b1; } }; struct TAtanTable { @@ -35,4 +38,12 @@ extern TAtanTable atanTable_; extern TAsinAcosTable asinAcosTable_; }; // namespace JMath +inline f32 JMASSin(s16 s) { + return JMath::sincosTable_.sinShort(s); +} + +inline f32 JMASCos(s16 s) { + return JMath::sincosTable_.cosShort(s); +} + #endif /* JMATRIGONOMETRIC_H */ |
