Commit Graph

241 Commits

Author SHA1 Message Date
Ray
570082deba WARNING: **NEW** raylib code CONVENTION: Comments do not end with '.' 2025-08-07 18:23:20 +02:00
Jeff Myers
ffe76a4b67 Don't Upload Meshes in LoadObj, LoadModel will upload them. None of the other interchange format readers upload 2025-08-02 14:58:05 -07:00
Eike Decker
121c996c6e fixing OBJ loading crash when there are no normals present 2025-08-01 08:49:48 +02:00
Ray
8343aed4f6 Avoid fatal errors on OBJ model loading 2025-07-26 12:50:12 +02:00
sir-irk
bee524e5e6 fixing offset for processing tangents for gltf loading 2025-07-01 13:23:05 -05:00
Ray
59bcf680aa Code gardening... 2025-06-07 20:14:24 +02:00
Ray
5ddd13b775 REVIEWED: Hexadecimal formatting to be consistent 2025-05-28 17:18:02 +02:00
Colby Newman
21e711b13f Fix typo in mesh animNormals 2025-05-18 19:35:21 -04:00
Bigfoot71
d135eef462 fix and improve GenMeshTangents 2025-05-12 23:16:06 +02:00
Ray
693c9c292a Formatting tweaks 2025-05-10 22:45:08 +02:00
Karl Zylinski
a15548fb5a Add normals to DrawSphereEx 2025-05-06 13:09:05 +02:00
Jeffery Myers
ee2ab11cc5 Use the animated verts and normals in GL 1.1 if they exist 2025-05-05 15:49:23 -07:00
Jeffery Myers
e53a43b7b5 Assign meshes without bone weights to the bone they are attached to so they animate. 2025-05-04 17:32:37 -07:00
d.isakov
42a40b3920 move first mesh bones calculation under check for its presense 2025-04-16 08:04:58 +02:00
d.isakov
b4f1ff9a00 #4888 fix UpdateModelAnimationBones scale transform 2025-04-16 07:49:26 +02:00
Ray
4c8c72778d Remove trailing spaces 2025-03-10 17:04:29 +01:00
Ray
654131799e Minor tweaks 2025-03-02 13:43:15 +01:00
Le Juez Victor
c647d33703 Better default values for normals and tangents (VBOs) (#4763) 2025-02-14 01:00:05 +01:00
Ray
cceabf6961 Formatting review 2025-02-02 13:00:20 +01:00
Ray
cfe96931f5 REVIEWED: Formatting #4739 2025-02-02 12:59:34 +01:00
Nikolas
bddb5df0d4 [rmodels] Separate GLTF roughness and metallic channels on load (#4739) 2025-02-02 12:48:18 +01:00
Ray
94f261c6d7 Update rmodels.c 2025-01-16 19:47:12 +01:00
Ray
fa0eada61a Update year to 2025 2025-01-01 00:02:52 +01:00
Peter Zmanovsky
d1315e8a04 [rmodels] Fix leaks in LoadIQM() and LoadModelAnimationsIQM() (#4649)
Add calls to UnloadFileData() before return in cases of invalid IQM file.
2024-12-29 21:06:40 +01:00
Le Juez Victor
873bf31be3 [rmodels] Fix normal transform in UpdateModelAnimationBones (#4634)
* remove duplicate calculation of `invRotation` in `UpdateModelAnimationBones`

* fix normal transform in `UpdateModelAnimation`
2024-12-24 20:17:37 +01:00
Ray
ae3c0df206 Reviewed formating, removed assert() #4635 2024-12-24 20:14:54 +01:00
Jett
a7686c47b3 resolved a few segfaults with animation system (#4635)
* Update rmodels.c

resolves segfault with missing bone weights or bone IDs

* Update rmodels.c segfault with animation and missing normals/animnormals

* correct place.
2024-12-24 20:11:17 +01:00
Ray
6f0d8611fe Formating tweaks 2024-12-23 19:24:07 +01:00
Ray
f76734fc50 REVIEWED: UpdateModelAnimationBones(), break on first mesh found and formating 2024-12-18 11:43:43 +01:00
Kirandeep-Singh-Khehra
35c2408413 [rmodels] Optimized UpdateModelAnimationBones() function (#4602)
- Updating bones only once instead for each mesh.
 - Updating only one `model.meshes[].boneMatrices` and then using deep copy for other meshes instead of calculating for each bone in each mesh.

**Other points:**
 - Makes it a clean base/template/reference for bone updation functions. Because if using this as template then some calculations done in one mesh can affect bones in other mesh in next iteration(doubles the effect in for next mesh).

Signed-off-by: Kirandeep-Singh-Khehra <kirandeepsinghkhehra@gmail.com>
2024-12-18 11:39:50 +01:00
Michael
d2cd2a0152 [rlgl][rmodels] Add instranceTransform shader location index #4538 (#4579) 2024-12-08 12:48:54 +01:00
Ray
602583bcdb Merge branch 'master' of https://github.com/raysan5/raylib 2024-12-03 19:14:29 +01:00
Ray
1f45e7af76 REVIEWED: Coding conventions 2024-12-03 19:14:14 +01:00
Caleb Heydon
5feccb1bab [rmodels] Fixed null pointer dereference in LoadGLTF (#4564)
* [rmodels] Fixed null pointer dereference in LoadGLTF

* [rmodels] Add parenthesis around conditionals in LoadGLTF
2024-12-03 18:35:24 +01:00
Caleb Heydon
f3f5f38c0f [rmodels] Fix crash when NULL is passed to LoadImageFromCgltfImage (#4563) 2024-12-02 13:35:54 +01:00
Ray
962f1c26ff Review formatting to follow raylib conventions 2024-12-01 23:10:59 +01:00
Caleb Heydon
9047630ae7 [rmodels] Fix null pointer dereference in LoadImageFromCgltfImage (#4557) 2024-12-01 22:46:26 +01:00
mikeemm
95e766472f [rmodels] Improve OBJ vertex data precision and lower memory usage by ExportMesh() (#4496)
* increased vertex data precision to match blender exports

* modified memory allocation to better fit higher precision data

* now accounting for newline characters during allocation

* now accounting for potentially higher vertex counts

* removed unnecessary final newline
2024-11-19 10:35:47 +01:00
Eike Decker
7c5d74e98e Fixing an OBJ loader bug that fragmented the loaded meshes (#4494)
The nextShapeEnd integer is a pointer in the OBJ data structures.
The faceVertIndex is a vertex index counter for the mesh we are
about to create. Both integers are not compatible, which causes
the code to finish the meshes too early, thus writing the OBJ data
incompletely into the target meshes.

It wasn't noticed because for the last mesh, it process all remaining
data, causing the last mesh to contain all remaining triangles.

This would have been noticed if the OBJ meshes used different textures
for each mesh.
2024-11-15 16:40:14 +01:00
Jeffery Myers
2af4f31712 Fix the X axis of the second vertex of the Y negative cap of a cylinders, triangle fan (#4478) 2024-11-10 22:04:58 +01:00
Jett
dc489786b0 UpdateModelAnimation speedup (#4470)
If we borrow from the GPU skinned animation code, we can just multiply the vertex by the matrix * weight and shave a chunk of CPU time.
2024-11-08 14:28:39 +01:00
Ray
be360d2ad1 RENAMED: UpdateModelAnimationBoneMatrices() to UpdateModelAnimationBones()
Still, not fully convinced of those functions naming, despite quite descriptive, sounds a bit confusing to me...
2024-11-03 13:12:01 +01:00
MikiZX1
8e5d5f89c2 Update rmodels.c - 'fix' for GenMeshSphere artifact (#4460)
When creating a new sphere mesh with high number of slices/rings the top and bottom parts of the generated sphere are removed. This happens because the triangles in those parts, due to high resolution, end up being very small and are removed as part of the 'par_shapes' library's optimization. Adding par_shapes_set_epsilon_degenerate_sphere(0.0); before generating the sphere mesh sets the threshold for removal of small triangles is removed and the sphere is returned to raylib correctly.
2024-11-01 22:35:35 +01:00
Ray
6ff0b03629 REVIEWED: UpdateModelAnimationBoneMatrices() comments 2024-10-24 12:46:02 +02:00
Ray
f141c75cde Removed trailing spaces 2024-10-21 17:00:52 +02:00
Le Juez Victor
23354e1551 correction of comments (#4400)
The indication of locations for bone ids and bone weights did not correspond to their default values ​​in config.h
2024-10-21 00:26:15 +02:00
Ray
8cbf34ddc4 WARNING: BREAKING: Renamed several functions for data validation #3930 2024-10-16 19:26:12 +02:00
Harald Scheirich
454acca84b Some update to gltf loading (#4373)
Only warns when there are more animations than currently implemented
Allows mesh indices to be unsigned char
2024-10-10 18:53:02 +02:00
Ray
3fb1ba25ac Removed tabs and triple line-breaks 2024-10-08 18:45:52 +02:00
Asdqwe
96d91a3892 [rlgl] Fix rlgl standalone defaults (#4357)
* Fix rlgl standalone defaults

* Fix rmodels
2024-10-02 11:41:21 +02:00