summaryrefslogtreecommitdiffhomepage
path: root/src/models.c
AgeCommit message (Collapse)Author
2021-03-14Implement UnloadModelAnimations (#1648)Hristo Stamenov
2021-03-14Improve gltf support (#1647)Hristo Stamenov
* Implement a load values from accessor function. Added some more value types for the different GLTF attributes. Fixed crash when loading animated triangle. * Split GLTF model loading into separate functions for readability. * Fixed the already working models that I broke when introducing GLTFReadValue. Improved the example for gltf models to be able to switch between a few models. * Removed license from screen. It is pu inside a license file anyway. * Small improvements on the naming of functions Removed (*model). and replaced it with model->
2021-03-14WARNING: VERY BREAKING CHANGE: Renamed some enum values for consistencyRay
Some enums values have been renamed to be more consistent and also provide a more detailed description: - ShaderLocationIndex: LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION - ShaderUniformDataType: UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2 - MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO - PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
2021-03-09Gltf model and animations exploring problems (#1635)Hristo Stamenov
* Added bone binding to whole mesh and not only set vertices. + Also added missed setting of the animation count. + Removed double ; on one line * Added more of the gltf sample models https://github.com/KhronosGroup/glTF-Sample-Models We need to make it working for all of them. * Binding to initial bind pose added. * Fix cube disappearing bug because lerpPercent could be Inf. * Fixed for rigged figure also
2021-03-02Some misc tweaksRay
2021-03-02REVIEWED: rlUnloadMesh() #1615Ray
2021-02-24Patch up GLTF Skeleton loading (#1610)Chris Sinclair
* Add support for u8 bone indicies when loading glTF * Fix segfault for glTF animations not keyframed at 0 When loading glTF animations we lerp between keyframes, and previously assume that if the frame we are considering has a later keyframe, there must be a previous keyframe. This is not true if the animation's first keyframe is some time into the animation. In this case we now effectively clamp to that first keyframe for any time prior to it. * Respect parent bones tranform when loading glTF animations We previously assumed that when loading glTF animations, the bones were ordered with those higher up the skeleton tree (i.e. closer to the root) came first in the list of nodes. This may not be true, so now we repeatedly loop, preparing each level of the skeleton tree one after the other, starting at the root level. This ensures that any parent transforms are applied before transforming any child bones. We also ensure that we have forced the loading of animation data before attempting to interpolate to generate the animation frames for use later, without this no animations are applied. Finally we remove the check that assumed the first node in the nodes list is the root, and use an invalid index value as the sentinal value for when a node has no parent. Previously this was 0, which made distinguishing between root nodes and children of the first node impossible.
2021-02-21[models] Move vboId ALLOC/FREE to rlgl module #1603Ray
Actually, it seems more logical that rlgl takes care of OpenGL data than the models module... Also, models module loaded vertex data is unloaded by models module.
2021-02-20Fix warnings generated by Visual Studio 2019 in new model loading code. (#1600)Jeffery Myers
Co-authored-by: Jeffery Myers <[email protected]>
2021-02-16check to make sure parent bone is not null before trying to compute its ↵Jeffery Myers
offset from the root (#1594)
2021-02-09Review some warnings and formattingraysan5
2021-02-06REVIEWED: Replace GetImageData() by LoadImageColors()raysan5
2021-02-05REMOVED: MeshNormalsSmooth() #1421raysan5
Current implementation is probably wrong and it should be reimplemented from scratch, in the meantime, I prefer to remove the function.
2021-02-02Update loading of gltf animation. (#1561)hristo
This is to account for GLTF info being more like instructions on how to build your animation instead of verbose description of each pose.
2021-01-28Gltf animation support (#1551)hristo
* Added example for gltf animation and split some functions for loading model animations into IQM and GLTF similar to how models are being loaded. * Removed wrongly duplicated function * Bone loading for gltf model (not working at this point) * Loading info about vertex to joint connection but animation is still not working * Skeleton and pose is correctly loaded. Need to communicate about interpolation in GLTF * The model almost looks like a real person on animation. * Fixed model loading with bones. Also updated license info on the model. * Cleaned up some code and updated examples. * Fix identation issues * Fix identation issues * Fix identation issues
2021-01-22ADDED: UploadMesh() #1529Ray
Upload mesh data to GPU and get VAO/VBO identifiers
2021-01-03Removed a repeating allocation of memory (#1507)hristo
Resolves #1495 This line allocated some memory that was already allocated in the beginning of the function and was essentially creating a leak.
2021-01-02Update year to 2021raysan5
2020-12-31 Avoid dereferencing a null pointer in the 'LoadMaterials' function in the ↵Victor Gallet
models module (#1498)
2020-12-24Replace TABS by 4 spacesraysan5
2020-12-23Remove trailing spacesraysan5
2020-12-19REVIEW: CheckCollisionSpheres() params namingRay
2020-12-19Avoid *Rec suffix in some variablesRay
Pefixing/Suffixing some data type identifier in the variables is not a convention used in raylib, just reviewed it for consistency... Still, I kept the *Rec suffix in some functions.
2020-12-14REVIEWED: DrawGrid(), issue with buffer limits check #1417Ray
2020-12-14Added some security checks on GenMesh*() #1454Ray
2020-12-14Add mesh collision function so we can check meshes directly instead of ↵Jeffery Myers
having to put them in a model. (#1459) Make model collision function call the mesh function.
2020-12-03Review commentRay
2020-12-01ADDED: UnloadModelKeepMeshes() #1441Ray
2020-12-01Review for issue #1446Ray
2020-11-30Fix typecast warnings in raylib code as reported by visual studio 2019 (#1443)Jeffery Myers
2020-11-22Exposing some file access results to user layer #1420Ray
2020-11-21Reverted to previous working version #1434Ray
2020-11-17Update to latest tiniobjloaderRay
WARNING: OBJ loading is broken at this point...
2020-11-15Updated tinyobjloaderraysan5
2020-11-03Remove trailing spacesRay
2020-10-08allow for multiple materials in obj files (#1408)chriscamacho
* allow for multiple materials in obj files also fix obj_loader hash map issues * minor fix for warning Co-authored-by: codifies <[email protected]>
2020-09-18WARNING: REDESIGN of rlgl framebuffers API #721raysan5
This redesign allows more flexibility when creating RenderTexture and a simplification (and hopefully removal) of `GenTexture*()` functions, that should not belong to this model but the user code, due to the use of custom shaders. Also, this new API opens the door for a possible GBuffers type and advance rendering possibilities... Some functions of the API have been also simplified or even removed. rlgl module can be used as an standalone library, so, a version for the library has been added: v3.1.0, matching current raylib version.
2020-09-13Minor tweakRay
2020-09-13Corrected issue on logRay
2020-08-30Remove unused variableraysan5
2020-07-20[wip] MeshNormalsSmooth() (#1317)seanpringle
* MeshSmoothNormals() by average * wrong comment * spelling * use correct function naming convention
2020-07-17Reviewed comment in LoadIQM() #1315raysan5
2020-07-15clamp ray hit y position to ground plane height (#1311)seanpringle
2020-06-23Add missing includeRay
2020-06-05Fixed buffer overflow in GenMeshPoly (#1269)frithrah
Co-authored-by: frithrah <[email protected]>
2020-05-23REDESIGNED: ExportMesh() to use memory buffer #1232raysan5
This change could introduce an issue on dataSize precalculation...
2020-05-23REDESIGNED: LoadIQM(), LoadModelAnimations() to use mem buffersraysan5
2020-05-18Avoid loading texcoords and normasl from model if not existentraysan5
2020-05-11GenMeshCubicmap() added comments and simplificationraysan5
2020-05-11Fixed Generated Normals for GenMeshCubicmap (#1244)GoldenThumbs
Just flipped the signs of `n5` and `n6` at lines `2021` and `2022`.