MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / arcCosFixed

Function arcCosFixed

TheForceEngine/TFE_Jedi/Math/core_math.cpp:167–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 }
166
167 angle14_32 arcCosFixed(fixed16_16 sinAngle, angle14_32 angle)
168 {
169 const fixed16_16* cosTable = s_cosTable;
170 if (sinAngle >= 0)
171 {
172 s_negArcCos = 0;
173 }
174 else
175 {
176 s_negArcCos = 1;
177 sinAngle = -angle;
178 }
179 s32 i = 0;
180 for (; i < 4095; i++, cosTable++)
181 {
182 if (sinAngle >= *cosTable)
183 {
184 break;
185 }
186 }
187
188 angle14_32 resAngle = 4095 - i;
189 if (s_negArcCos)
190 {
191 resAngle += 8192;
192 }
193 return resAngle;
194 }
195
196 /////////////////////////////////////////////
197 // Floating point

Callers 2

proj_aimArcingFunction · 0.85
actor_jumpToTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected