summaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorjussi2024-02-25 14:06:59 +0200
committerjussi2024-02-25 14:06:59 +0200
commit47ed28b006db71d823cfaa24fa143ab5cfcf279b (patch)
treeadf35906662b0646a14adfa6a37260c797cd325a /src/models.c
parent631cea6aa7510ba53d4f14b5537e1719a72976b9 (diff)
downloadreilua-enhanced-47ed28b006db71d823cfaa24fa143ab5cfcf279b.tar.gz
reilua-enhanced-47ed28b006db71d823cfaa24fa143ab5cfcf279b.tar.bz2
reilua-enhanced-47ed28b006db71d823cfaa24fa143ab5cfcf279b.zip
Added various missing functions.
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c
index 2133632..db98b31 100644
--- a/src/models.c
+++ b/src/models.c
@@ -173,6 +173,32 @@ int lmodelsDrawTriangle3D( lua_State* L ) {
}
/*
+> RL.DrawTriangleStrip3D( Vector3{} points, Color color )
+
+Draw a triangle strip defined by points
+*/
+int lmodelsDrawTriangleStrip3D( lua_State* L ) {
+ int pointCount = uluaGetTableLen( L, 1 );
+ Color color = uluaGetColor( L, 2 );
+
+ Vector3 points[ pointCount ];
+
+ int t = 1, i = 0;
+ lua_pushnil( L );
+
+ while ( lua_next( L, t ) != 0 ) {
+ if ( lua_istable( L, -1 ) ) {
+ points[i] = uluaGetVector3( L, lua_gettop( L ) );
+ }
+ i++;
+ lua_pop( L, 1 );
+ }
+ DrawTriangleStrip3D( points, pointCount, color );
+
+ return 0;
+}
+
+/*
> RL.DrawCube( Vector3 position, Vector3 size, Color color )
Draw cube
@@ -1305,6 +1331,23 @@ int lmodelsGenMeshSphere( lua_State* L ) {
}
/*
+> mesh = RL.GenMeshHemiSphere( float radius, int rings, int slices )
+
+Generate half-sphere mesh (no bottom cap)
+
+- Success return Mesh
+*/
+int lmodelsGenMeshHemiSphere( lua_State* L ) {
+ float radius = luaL_checknumber( L, 1 );
+ int rings = luaL_checkinteger( L, 2 );
+ int slices = luaL_checkinteger( L, 3 );
+
+ uluaPushMesh( L, GenMeshHemiSphere( radius, rings, slices ) );
+
+ return 1;
+}
+
+/*
> mesh = RL.GenMeshCylinder( float radius, float height, int slices )
Generate cylinder mesh