MCPcopy Create free account
hub / github.com/WheretIB/nullc / nullcInitMathModule

Function nullcInitMathModule

NULLC/includes/math.cpp:184–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183#define REGISTER_FUNC(funcPtr, name, index) if(!nullcBindModuleFunction("std.math", (void(*)())NULLCMath::funcPtr, name, index)) return false;
184bool nullcInitMathModule()
185{
186 REGISTER_FUNC(Cos, "cos", 0);
187 REGISTER_FUNC(Sin, "sin", 0);
188 REGISTER_FUNC(Tan, "tan", 0);
189 REGISTER_FUNC(Ctg, "ctg", 0);
190
191 REGISTER_FUNC(Cosh, "cosh", 0);
192 REGISTER_FUNC(Sinh, "sinh", 0);
193 REGISTER_FUNC(Tanh, "tanh", 0);
194 REGISTER_FUNC(Coth, "coth", 0);
195
196 REGISTER_FUNC(Acos, "acos", 0);
197 REGISTER_FUNC(Asin, "asin", 0);
198 REGISTER_FUNC(Atan, "atan", 0);
199
200 REGISTER_FUNC(Ceil, "ceil", 0);
201 REGISTER_FUNC(Floor, "floor", 0);
202 REGISTER_FUNC(Exp, "exp", 0);
203 REGISTER_FUNC(Log, "log", 0);
204
205 REGISTER_FUNC(Sqrt, "sqrt", 0);
206
207 REGISTER_FUNC(clamp, "clamp", 0);
208 REGISTER_FUNC(saturate, "saturate", 0);
209 REGISTER_FUNC(abs, "abs", 0);
210
211 REGISTER_FUNC(operatorIndex2, "[]", 0);
212 REGISTER_FUNC(operatorIndex3, "[]", 1);
213 REGISTER_FUNC(operatorIndex4, "[]", 2);
214
215 REGISTER_FUNC(length2, "float2::length", 0);
216 REGISTER_FUNC(normalize2, "float2::normalize", 0);
217
218 REGISTER_FUNC(length3, "float3::length", 0);
219 REGISTER_FUNC(normalize3, "float3::normalize", 0);
220
221 REGISTER_FUNC(length3, "float4::length", 0);
222 REGISTER_FUNC(normalize3, "float4::normalize", 0);
223
224 REGISTER_FUNC(dot2, "dot", 0);
225 REGISTER_FUNC(dot3, "dot", 1);
226 REGISTER_FUNC(dot4, "dot", 2);
227 return true;
228}

Callers 5

RunTestsFunction · 0.85
WinMainFunction · 0.85
mainFunction · 0.85
RunMethod · 0.85
SpeedTestTextFunction · 0.85

Calls

no outgoing calls

Tested by 3

RunTestsFunction · 0.68
RunMethod · 0.68
SpeedTestTextFunction · 0.68