NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
trigonometry.hpp
Go to the documentation of this file.
1#pragma once
2#include <types.h>
5
6namespace nw4r {
7namespace math {
8
12float SinFIdx(float fidx);
13
17float CosFIdx(float fidx);
18
22inline float SinF(float ang) {
23 return SinFIdx(ang * (1.0f / 256.f));
24}
25
29inline float CosF(float ang) {
30 return CosFIdx(ang * (1.0f / 256.f));
31}
32
36inline float SinS(short ang) {
37 return SinF(OSu16tof32((u16 *) &ang));
38}
39
43inline float CosS(short ang) {
44 return CosF(OSu16tof32((u16 *) &ang));
45}
46
47} // namespace math
48} // namespace nw4r
float OSu16tof32(register u16 *in)
Converts an unsigned short value into a single-precision floating point value.
Definition OSFastCast.h:21
float CosS(short ang)
Computes the cosine value.
float SinS(short ang)
Computes the sine value.
float CosF(float ang)
Computes the cosine value.
float SinFIdx(float fidx)
Computes the sine value.
float SinF(float ang)
Computes the sine value.
float CosFIdx(float fidx)
Computes the cosine value.