summaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
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