MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / FixSin

Function FixSin

fix/fix.cpp:103–113  ·  view source on GitHub ↗

Returns the sine of the given angle. Linearly interpolates between two entries in a 256-entry table

Source from the content-addressed store, hash-verified

101
102// Returns the sine of the given angle. Linearly interpolates between two entries in a 256-entry table
103float FixSin(angle a) {
104 int i, f;
105 float s0, s1;
106
107 i = (a >> 8) & 0xff;
108 f = a & 0xff;
109
110 s0 = sincos_table[i];
111 s1 = sincos_table[i + 1];
112 return (float)(s0 + ((s1 - s0) * (double)f / 256.0));
113}
114
115// Returns the cosine of the given angle. Linearly interpolates between two entries in a 256-entry table
116float FixCos(angle a) {

Callers 15

BuildModelAngleMatrixFunction · 0.50
vm_AnglesToMatrixFunction · 0.50
vm_VectorAngleToMatrixFunction · 0.50
vm_SinCosFunction · 0.50
do_physics_simFunction · 0.50
BuildModelAngleMatrixFunction · 0.50
OnCreateVolumeConeMethod · 0.50
HTextureCreate2DRotMatFunction · 0.50
StartCockpitShakeFunction · 0.50
RenderCockpitFunction · 0.50
DrawPowerupGlowDiskFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected