From 8182a5f1b6c61bdf95d32a4ad102e1762f0d0924 Mon Sep 17 00:00:00 2001 From: jussi Date: Sun, 20 Feb 2022 20:37:39 +0200 Subject: Documentation and better cmakelist. --- src/rmath.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'src/rmath.c') diff --git a/src/rmath.c b/src/rmath.c index 7ad9bdb..4027aa8 100644 --- a/src/rmath.c +++ b/src/rmath.c @@ -889,14 +889,15 @@ int lmathMatrixFrustum( lua_State *L ) { lua_pushboolean( L, false ); return 1; } - float far = lua_tonumber( L, -1 ); - float near = lua_tonumber( L, -2 ); - float top = lua_tonumber( L, -3 ); - float bottom = lua_tonumber( L, -4 ); - float right = lua_tonumber( L, -5 ); - float left = lua_tonumber( L, -6 ); + // float far = lua_tonumber( L, -1 ); + // float near = lua_tonumber( L, -2 ); + // float top = lua_tonumber( L, -3 ); + // float bottom = lua_tonumber( L, -4 ); + // float right = lua_tonumber( L, -5 ); + // float left = lua_tonumber( L, -6 ); - uluaPushMatrix( L, MatrixFrustum( left, right, bottom, top, near, far ) ); + // uluaPushMatrix( L, MatrixFrustum( left, right, bottom, top, near, far ) ); + uluaPushMatrix( L, MatrixFrustum( lua_tonumber( L, -6 ), lua_tonumber( L, -5 ), lua_tonumber( L, -4 ), lua_tonumber( L, -3 ), lua_tonumber( L, -2 ), lua_tonumber( L, -1 ) ) ); return 1; } @@ -915,12 +916,13 @@ int lmathMatrixPerspective( lua_State *L ) { lua_pushboolean( L, false ); return 1; } - float far = lua_tonumber( L, -1 ); - float near = lua_tonumber( L, -2 ); - float aspect = lua_tonumber( L, -3 ); - float fovy = lua_tonumber( L, -4 ); + // float far = lua_tonumber( L, -1 ); + // float near = lua_tonumber( L, -2 ); + // float aspect = lua_tonumber( L, -3 ); + // float fovy = lua_tonumber( L, -4 ); - uluaPushMatrix( L, MatrixPerspective( fovy, aspect, near, far ) ); + // uluaPushMatrix( L, MatrixPerspective( fovy, aspect, near, far ) ); + uluaPushMatrix( L, MatrixPerspective( lua_tonumber( L, -4 ), lua_tonumber( L, -3 ), lua_tonumber( L, -2 ), lua_tonumber( L, -1 ) ) ); return 1; } @@ -940,14 +942,15 @@ int lmathMatrixOrtho( lua_State *L ) { lua_pushboolean( L, false ); return 1; } - float far = lua_tonumber( L, -1 ); - float near = lua_tonumber( L, -2 ); - float top = lua_tonumber( L, -3 ); - float bottom = lua_tonumber( L, -4 ); - float right = lua_tonumber( L, -5 ); - float left = lua_tonumber( L, -6 ); + // float far = lua_tonumber( L, -1 ); + // float near = lua_tonumber( L, -2 ); + // float top = lua_tonumber( L, -3 ); + // float bottom = lua_tonumber( L, -4 ); + // float right = lua_tonumber( L, -5 ); + // float left = lua_tonumber( L, -6 ); - uluaPushMatrix( L, MatrixOrtho( left, right, bottom, top, near, far ) ); + // uluaPushMatrix( L, MatrixOrtho( left, right, bottom, top, near, far ) ); + uluaPushMatrix( L, MatrixOrtho( lua_tonumber( L, -6 ), lua_tonumber( L, -5 ), lua_tonumber( L, -4 ), lua_tonumber( L, -3 ), lua_tonumber( L, -2 ), lua_tonumber( L, -1 ) ) ); return 1; } -- cgit v1.2.3