diff options
| author | Ray <[email protected]> | 2019-03-29 16:48:23 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-03-29 16:48:23 +0100 |
| commit | a643dc4ca016ce5791608852ab1357f2d94ebe9b (patch) | |
| tree | 49b2a4f847540a7437629ebd37c0cffd1d9f0a34 /src/raylib.h | |
| parent | 876c64b1e530b4b9826eef8fcfc5c3bc567c6be8 (diff) | |
| download | raylib-a643dc4ca016ce5791608852ab1357f2d94ebe9b.tar.gz raylib-a643dc4ca016ce5791608852ab1357f2d94ebe9b.zip | |
WARNING: Redesigned model struct for multi-meshes
This is quite a big change, Model struct has been redesigned to support multiple meshes and multiple materials, most 3d fileformats contain multiple meshes and reference multiple materials.
Consequently, multiple functions have been reviewed.
LoadOBJ(), LoadIQM(), LoadGLFT() now return a Model.
Current LoadOBJ() is not valid anymore, actually, tinyobj_loader_c library is considered for replacement.
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/raylib.h b/src/raylib.h index 5db50c04..1a344306 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -339,18 +339,15 @@ typedef struct Material { // Model type typedef struct Model { - Mesh mesh; // Vertex data buffers (RAM and VRAM) Matrix transform; // Local transform matrix - Material material; // Shader and textures data - /* - Mesh *meshes; // Vertex data buffers (RAM and VRAM) - int meshCount; - - Material *materials; // Shader and textures data - int materialCount; - - int *meshMaterial; // Material assigned to every mesh - */ + + int meshCount; // Number of meshes + Mesh *meshes; // Meshes array + + int materialCount; // Number of materials + Material *materials; // Materials array + + int *meshMaterial; // Mesh material number } Model; // Ray type (useful for raycast) @@ -1226,7 +1223,7 @@ RLAPI void DrawGizmo(Vector3 position); //------------------------------------------------------------------------------------ // Model loading/unloading functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (mesh and material) +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) |
