From 4c0eb17a9c234bfee73af408faa38e38f2e450d9 Mon Sep 17 00:00:00 2001 From: jussi Date: Thu, 21 Nov 2024 00:11:31 +0200 Subject: New raylib 5.5 functions. --- src/models.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'src/models.c') diff --git a/src/models.c b/src/models.c index 1271713..0caae47 100644 --- a/src/models.c +++ b/src/models.c @@ -982,6 +982,40 @@ int lmodelsDrawModelWiresEx( lua_State* L ) { return 0; } +/* +> 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 ) @@ -1286,6 +1320,21 @@ int lmodelsExportMesh( lua_State* L ) { return 1; } +/* +> 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 ) @@ -2190,6 +2239,21 @@ int lmodelsUpdateModelAnimation( lua_State* L ) { return 0; } +/* +> 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 ) -- cgit v1.2.3