diff options
author | sanine <sanine.not@pm.me> | 2023-02-22 17:35:17 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-02-22 17:35:17 -0600 |
commit | b5f0a45d9b10ebab8610ba235bc46f69fd58e2a2 (patch) | |
tree | 8fef6c14a2d5c1ad316cbc072af3d313908350d2 /src/glm/transform.c | |
parent | 353d60d3ebc353aef474633e7064067a2ef343ce (diff) |
begin cglm bind refactor
Diffstat (limited to 'src/glm/transform.c')
-rw-r--r-- | src/glm/transform.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/glm/transform.c b/src/glm/transform.c deleted file mode 100644 index daf75a5..0000000 --- a/src/glm/transform.c +++ /dev/null @@ -1,60 +0,0 @@ -#include <lua.h> -#include <honeysuckle.h> -#include <cglm/cglm.h> -#include "util/util.h" - - -int translate(lua_State *L); -int rotate(lua_State *L); -int rotate_z(lua_State *L); - - -void setup_transform(lua_State *L, int glm_tbl) -{ - int tbl = hs_create_table(L, - hs_str_cfunc("translate", translate), - hs_str_cfunc("rotate", rotate), - hs_str_cfunc("rotate_z", rotate_z), - ); - - append_table(L, glm_tbl, tbl); - lua_pop(L, 1); -} - - -int translate(lua_State *L) -{ - void *m_ptr, *v_ptr; - hs_parse_args(L, hs_user(m_ptr), hs_user(v_ptr)); - mat4 *m = m_ptr; - vec3 *v = v_ptr; - - glm_translate(*m, *v); - return 0; -} - - -int rotate(lua_State *L) -{ - void *m_ptr, *axis_ptr; - lua_Number angle; - hs_parse_args(L, hs_user(m_ptr), hs_num(angle), hs_user(axis_ptr)); - mat4 *m = m_ptr; - vec3 *axis = axis_ptr; - - glm_rotate(*m, angle, *axis); - return 0; -} - - -int rotate_z(lua_State *L) -{ - void *src_ptr, *dest_ptr; - lua_Number angle; - hs_parse_args(L, hs_user(src_ptr), hs_num(angle), hs_user(dest_ptr)); - mat4 *source = src_ptr; - mat4 *dest = dest_ptr; - - glm_rotate_z(*source, angle, *dest); - return 0; -} |