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

Function FixCos

fix/fix.cpp:116–126  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

114
115// Returns the cosine of the given angle. Linearly interpolates between two entries in a 256-entry table
116float FixCos(angle a) {
117 int i, f;
118 float c0, c1;
119
120 i = (a >> 8) & 0xff;
121 f = a & 0xff;
122
123 c0 = sincos_table[i + 64];
124 c1 = sincos_table[i + 64 + 1];
125 return (float)(c0 + ((c1 - c0) * (double)f / 256.0));
126}
127
128// Returns the sine of the given angle, but does no interpolation
129float FixSinFast(angle a) {

Callers 15

BuildModelAngleMatrixFunction · 0.50
vm_AnglesToMatrixFunction · 0.50
vm_VectorAngleToMatrixFunction · 0.50
vm_SinCosFunction · 0.50
BuildModelAngleMatrixFunction · 0.50
OnCreateVolumeConeMethod · 0.50
HTextureCreate2DRotMatFunction · 0.50
AddProcSphereLightningFunction · 0.50
AddProcSpinnersFunction · 0.50
AddProcSineBlobFunction · 0.50
RenderHUDShipStatusFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected