Module library
Contains a list of useful math and helper methods that would be slow to implement in Lua, and which are given here as fast C++ implementation.
Functions
systemResolution3 (vec_c1, vec_c2, vec_c3, vec_c0) | Solve the 3D linear system M*x=c0 where M is defined by its colum vectors c1,c2,c3. |
systemResolution2 (vec_c1, vec_c2, vec_c0) | Solve the 2D linear system M*x=c0 where M is defined by its colum vectors c1,c2. |
getPointOnScreen (worldPos) | Returns the position of the given point in world coordinates system, on the game screen. |
load () | Unknown use. |
mockGetClosure () | Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":". |
Functions
- systemResolution3 (vec_c1, vec_c2, vec_c3, vec_c0)
-
Solve the 3D linear system M*x=c0 where M is defined by its colum vectors c1,c2,c3.
Parameters:
- vec_c1 vec3 The first column of the matrix M.
- vec_c2 vec3 The second column of the matrix M.
- vec_c3 vec3 The third column of the matrix M.
- vec_c0 vec3 The target column of the matrix M.
Returns:
-
vec3
The vec3 solution of the above system.
- systemResolution2 (vec_c1, vec_c2, vec_c0)
-
Solve the 2D linear system M*x=c0 where M is defined by its colum vectors c1,c2.
Parameters:
- vec_c1 vec3 The first column of the matrix M.
- vec_c2 vec3 The second column of the matrix M.
- vec_c0 vec3 The target column of the matrix M.
Returns:
-
vec2
The vec2 solution of the above system.
- getPointOnScreen (worldPos)
-
Returns the position of the given point in world coordinates system, on the game screen.
Parameters:
- worldPos vec3 The world position of the point.
Returns:
-
vec3
The position in percentage (between 0 and 1) of the screen resolution as vec3 with {x, y, depth}.
- load ()
- Unknown use.
- mockGetClosure ()
-
Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".
Returns:
-
table
A table encompasing the api calls of object.