diff options
| author | jussi | 2023-11-09 20:48:16 +0200 |
|---|---|---|
| committer | jussi | 2023-11-09 20:48:16 +0200 |
| commit | ef75e2530dd92c55ba6b2462fe71fa888e1883df (patch) | |
| tree | a95469b8e5d83b601c998c32774ba5c1dd873a4e /API.md | |
| parent | 28ac27fae16d5d2df6174564dde05c6064515a33 (diff) | |
| download | reilua-enhanced-ef75e2530dd92c55ba6b2462fe71fa888e1883df.tar.gz reilua-enhanced-ef75e2530dd92c55ba6b2462fe71fa888e1883df.tar.bz2 reilua-enhanced-ef75e2530dd92c55ba6b2462fe71fa888e1883df.zip | |
GenMeshCubicmap, Organized model functions, GetModelBoundingBox, DrawModelWires and DrawModelWiresEx and LoadMaterials.
Diffstat (limited to 'API.md')
| -rw-r--r-- | API.md | 278 |
1 files changed, 164 insertions, 114 deletions
@@ -6060,7 +6060,7 @@ Draw multiple character (codepoint) > mouseCharId = RL.DrawTextBoxed(Font font, string text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint ) -Draw text using font inside rectangle limits. Return character from mouse position. Function from raylib [text] example - Rectangle bounds. +Draw text using font inside rectangle limits. Return character id from mouse position (default -1). Function from raylib [text] example - Rectangle bounds. - Success return int @@ -6068,7 +6068,7 @@ Draw text using font inside rectangle limits. Return character from mouse positi > mouseCharId = RL.DrawTextBoxedTinted( Font font, string text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tints, Color backTints ) -Draw text using font inside rectangle limits with support for tint and background tint for each character. Return character from mouse position +Draw text using font inside rectangle limits with support for tint and background tint for each character. Return character id from mouse position (default -1) - Success return int @@ -6143,7 +6143,7 @@ Get font texture atlas containing the glyphs. Return as lightuserdata --- -## Models - Basic +## Models - Basic geometric 3D shapes drawing functions --- @@ -6261,87 +6261,128 @@ Draw a grid (Centered at ( 0, 0, 0 )) --- -## Models - Mesh +## Models - Model management functions --- -> mesh = RL.GenMeshPoly( int sides, float radius ) +> model = RL.LoadModel( string fileName ) -Generate polygonal mesh +Load model from files (Meshes and materials) -- Success return Mesh +- Failure return nil +- Success return Model --- -> mesh = RL.GenMeshPlane( float width, float length, int resX, int resZ ) +> model = RL.LoadModelFromMesh( Mesh mesh ) -Generate plane mesh (With subdivisions) +Load model from generated mesh (Default material) -- Success return Mesh +- Success return Model --- -> mesh = RL.GenMeshCube( Vector3 size ) +> isReady = RL.IsModelReady( Model model ) -Generate cuboid mesh +Check if a model is ready -- Success return Mesh +- Success return bool --- -> mesh = RL.GenMeshSphere( float radius, int rings, int slices ) +> RL.UnloadModel( Model model ) -Generate sphere mesh (Standard sphere) +Unload model (including meshes) from memory (RAM and/or VRAM) -- Success return Mesh +--- + +> boundingBox = RL.GetModelBoundingBox( Model model ) + +Compute model bounding box limits (considers all meshes) + +- Success return BoundingBox --- -> mesh = RL.GenMeshCylinder( float radius, float height, int slices ) +> RL.SetModelMaterial( Model model, Material modelMaterial, Material material ) -Generate cylinder mesh +Copies material to model material. (Model material is the material id in models.) -- Success return Mesh +--- + +> RL.SetModelMeshMaterial( Model model, int meshId, int materialId ) + +Set material for a mesh (Mesh and material on this model) --- -> mesh = RL.GenMeshCone( float radius, float height, int slices ) +> RL.SetModelTransform( Model model, Matrix transform ) -Generate cone/pyramid mesh +Set model transform matrix -- Success return Mesh +--- + +> transform = RL.GetModelTransform( Model model ) + +Get model transform matrix + +- Success return Matrix --- -> mesh = RL.GenMeshTorus( float radius, float size, int radSeg, int sides ) +## Models - Model drawing functions -Generate torus mesh +--- -- Success return Mesh +> RL.DrawModel( Model model, Vector3 position, float scale, Color tint ) + +Draw a model (With texture if set) --- -> mesh = RL.GenMeshKnot( float radius, float size, int radSeg, int sides ) +> RL.DrawModelEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) -Generate torus mesh +Draw a model with extended parameters -- Success return Mesh +--- + +> RL.DrawModelWires( Model model, Vector3 position, float scale, Color tint ) + +Draw a model wires (with texture if set) --- -> mesh = RL.GenMeshHeightmap( Image heightmap, Vector3 size ) +> RL.DrawModelWiresEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) -Generate heightmap mesh from image data +Draw a model wires (with texture if set) with extended parameters -- Success return Mesh +--- + +> RL.DrawBoundingBox( BoundingBox box, Color color ) + +Draw bounding box (wires) --- -> mesh = RL.GenMeshCustom( Mesh{} meshData, bool dynamic ) +> RL.DrawBillboard( Camera3D camera, Texture texture, Vector3 position, float size, Color tint ) -Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO +Draw a billboard texture -- Success return Mesh +--- + +> RL.DrawBillboardRec( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector2 size, Color tint ) + +Draw a billboard texture defined by source + +--- + +> RL.DrawBillboardPro( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint ) + +Draw a billboard texture defined by source and rotation + +--- + +## Models - Mesh management functions --- @@ -6402,210 +6443,219 @@ Compute mesh tangents --- -## Models - Material +## Models - Mesh generation functions --- -> material = RL.GetMaterialDefault() +> mesh = RL.GenMeshPoly( int sides, float radius ) -Default material for reference. Return as lightuserdata +Generate polygonal mesh -- Success return Material +- Success return Mesh --- -> material = RL.LoadMaterialDefault() +> mesh = RL.GenMeshPlane( float width, float length, int resX, int resZ ) -Load default material as new object +Generate plane mesh (With subdivisions) -- Success return Material +- Success return Mesh --- -> material = RL.CreateMaterial( Material{} materialData ) +> mesh = RL.GenMeshCube( Vector3 size ) -Load material from table. See material table definition +Generate cuboid mesh -- Success return Material +- Success return Mesh --- -> isReady = RL.IsMaterialReady( Material material ) +> mesh = RL.GenMeshSphere( float radius, int rings, int slices ) -Check if a material is ready +Generate sphere mesh (Standard sphere) -- Success return bool +- Success return Mesh --- -> RL.UnloadMaterial( Material material ) - -Unload material from GPU memory (VRAM) - ---- +> mesh = RL.GenMeshCylinder( float radius, float height, int slices ) -> RL.SetMaterialTexture( Material material, int mapType, Texture texture ) +Generate cylinder mesh -Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...) +- Success return Mesh --- -> RL.SetMaterialColor( Material material, int mapType, Color color ) +> mesh = RL.GenMeshCone( float radius, float height, int slices ) -Set color for a material map type +Generate cone/pyramid mesh + +- Success return Mesh --- -> RL.SetMaterialValue( Material material, int mapType, float value ) +> mesh = RL.GenMeshTorus( float radius, float size, int radSeg, int sides ) -Set value for a material map type +Generate torus mesh + +- Success return Mesh --- -> RL.SetMaterialShader( Material material, Shader shader ) +> mesh = RL.GenMeshKnot( float radius, float size, int radSeg, int sides ) -Set shader for material +Generate torus mesh + +- Success return Mesh --- -> RL.SetMaterialParams( Material material, float{} params ) +> mesh = RL.GenMeshHeightmap( Image heightmap, Vector3 size ) -Set material generic parameters (if required) +Generate heightmap mesh from image data + +- Success return Mesh --- -> texture = RL.GetMaterialTexture( Material material, int mapType ) +> mesh = RL.GenMeshCubicmap( Image cubicmap, Vector3 cubeSize ) -Get texture from material map type. Returns -1 if no texture +Generate cubes-based map mesh from image data -- Success return Texture +- Success return Mesh --- -> color = RL.GetMaterialColor( Material material, int mapType ) +> mesh = RL.GenMeshCustom( Mesh{} meshData, bool dynamic ) -Get color from material map type +Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO -- Success return Color +- Success return Mesh --- -> value = RL.GetMaterialValue( Material material, int mapType ) - -Get color from material map type - -- Success return float +## Models - Material management functions --- -> shader = RL.GetMaterialShader( Material material ) +> materials = RL.LoadMaterials( string fileName ) -Get material shader +Load materials from model file -- Success return Shader. Return as lightuserdata +- Success return Material{} --- -> params = RL.GetMaterialParams( Material material ) +> material = RL.GetMaterialDefault() -Get material parameters +Default material for reference. Return as lightuserdata -- Success return float{} +- Success return Material --- -## Models - Model +> material = RL.LoadMaterialDefault() + +Load default material as new object + +- Success return Material --- -> model = RL.LoadModel( string fileName ) +> material = RL.CreateMaterial( Material{} materialData ) -Load model from files (Meshes and materials) +Load material from table. See material table definition -- Failure return nil -- Success return Model +- Success return Material --- -> model = RL.LoadModelFromMesh( Mesh mesh ) +> isReady = RL.IsMaterialReady( Material material ) -Load model from generated mesh (Default material) +Check if a material is ready -- Success return Model +- Success return bool --- -> isReady = RL.IsModelReady( Model model ) - -Check if a model is ready +> RL.UnloadMaterial( Material material ) -- Success return bool +Unload material from GPU memory (VRAM) --- -> RL.UnloadModel( Model model ) +> RL.SetMaterialTexture( Material material, int mapType, Texture texture ) -Unload model (including meshes) from memory (RAM and/or VRAM) +Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...) --- -> RL.DrawModel( Model model, Vector3 position, float scale, Color tint ) +> RL.SetMaterialColor( Material material, int mapType, Color color ) -Draw a model (With texture if set) +Set color for a material map type --- -> RL.DrawModelEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) +> RL.SetMaterialValue( Material material, int mapType, float value ) -Draw a model with extended parameters +Set value for a material map type --- -> RL.SetModelMaterial( Model model, Material modelMaterial, Material material ) +> RL.SetMaterialShader( Material material, Shader shader ) -Copies material to model material. (Model material is the material id in models.) +Set shader for material --- -> RL.SetModelMeshMaterial( Model model, int meshId, int materialId ) +> RL.SetMaterialParams( Material material, float{} params ) -Set material for a mesh (Mesh and material on this model) +Set material generic parameters (if required) --- -> RL.DrawBillboard( Camera3D camera, Texture texture, Vector3 position, float size, Color tint ) +> texture = RL.GetMaterialTexture( Material material, int mapType ) -Draw a billboard texture +Get texture from material map type. Returns -1 if no texture + +- Success return Texture --- -> RL.DrawBillboardRec( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector2 size, Color tint ) +> color = RL.GetMaterialColor( Material material, int mapType ) -Draw a billboard texture defined by source +Get color from material map type + +- Success return Color --- -> RL.DrawBillboardPro( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint ) +> value = RL.GetMaterialValue( Material material, int mapType ) -Draw a billboard texture defined by source and rotation +Get color from material map type + +- Success return float --- -> RL.SetModelTransform( Model model, Matrix transform ) +> shader = RL.GetMaterialShader( Material material ) -Set model transform matrix +Get material shader + +- Success return Shader. Return as lightuserdata --- -> transform = RL.GetModelTransform( Model model ) +> params = RL.GetMaterialParams( Material material ) -Get model transform matrix +Get material parameters -- Success return Matrix +- Success return float{} --- -## Model - Animations +## Model - Model animations management functions --- @@ -6648,7 +6698,7 @@ Return modelAnimation frame count --- -## Model - Collision +## Model - Collision detection functions --- |
