summaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorjussi2024-11-21 00:11:31 +0200
committerjussi2024-11-21 00:11:31 +0200
commit4c0eb17a9c234bfee73af408faa38e38f2e450d9 (patch)
tree4aea4fe804a63ed13a1d092aada0ba5925dcf05f /src/models.c
parent479726a5e468a2f4d0f9337f082889082e535bfb (diff)
downloadreilua-enhanced-4c0eb17a9c234bfee73af408faa38e38f2e450d9.tar.gz
reilua-enhanced-4c0eb17a9c234bfee73af408faa38e38f2e450d9.tar.bz2
reilua-enhanced-4c0eb17a9c234bfee73af408faa38e38f2e450d9.zip
New raylib 5.5 functions.
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c
index 1271713..0caae47 100644
--- a/src/models.c
+++ b/src/models.c
@@ -983,6 +983,40 @@ int lmodelsDrawModelWiresEx( lua_State* L ) {
}
/*
+> RL.DrawModelPoints( Model model, Vector3 position, float scale, Color tint )
+
+Draw a model as points
+*/
+int lmodelsDrawModelPoints( lua_State* L ) {
+ Model* model = uluaGetModel( L, 1 );
+ Vector3 position = uluaGetVector3( L, 2 );
+ float scale = luaL_checknumber( L, 3 );
+ Color tint = uluaGetColor( L, 4 );
+
+ DrawModelPoints( *model, position, scale, tint );
+
+ return 0;
+}
+
+/*
+> RL.DrawModelPointsEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint )
+
+Draw a model as points with extended parameters
+*/
+int lmodelsDrawModelPointsEx( lua_State* L ) {
+ Model* model = uluaGetModel( L, 1 );
+ Vector3 position = uluaGetVector3( L, 2 );
+ Vector3 rotationAxis = uluaGetVector3( L, 3 );
+ float rotationAngle = luaL_checknumber( L, 4 );
+ Vector3 scale = uluaGetVector3( L, 5 );
+ Color tint = uluaGetColor( L, 6 );
+
+ DrawModelPointsEx( *model, position, rotationAxis, rotationAngle, scale, tint );
+
+ return 0;
+}
+
+/*
> RL.DrawBoundingBox( BoundingBox box, Color color )
Draw bounding box (wires)
@@ -1287,6 +1321,21 @@ int lmodelsExportMesh( lua_State* L ) {
}
/*
+> success = RL.ExportMeshAsCode( Mesh mesh, string fileName )
+
+Export mesh as code file (.h) defining multiple arrays of vertex attributes
+
+- Success return bool
+*/
+int lmodelsExportMeshAsCode( lua_State* L ) {
+ Mesh* mesh = uluaGetMesh( L, 1 );
+
+ lua_pushboolean( L, ExportMeshAsCode( *mesh, luaL_checkstring( L, 2 ) ) );
+
+ return 1;
+}
+
+/*
> boundingBox = RL.GetMeshBoundingBox( Mesh mesh )
Compute mesh bounding box limits
@@ -2191,6 +2240,21 @@ int lmodelsUpdateModelAnimation( lua_State* L ) {
}
/*
+> RL.UpdateModelAnimationBones( Model model, ModelAnimation animation, int frame )
+
+Update model animation mesh bone matrices (GPU skinning)
+*/
+int lmodelsUpdateModelAnimationBones( lua_State* L ) {
+ Model* model = uluaGetModel( L, 1 );
+ ModelAnimation* animation = uluaGetModelAnimation( L, 2 );
+ int frame = luaL_checkinteger( L, 3 );
+
+ UpdateModelAnimationBones( *model, *animation, frame );
+
+ return 0;
+}
+
+/*
> RL.UnloadModelAnimation( ModelAnimation animation )
Unload animation data