1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add static glTF support (#14557)

Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: jordan4ibanez <jordan4ibanez@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
This commit is contained in:
JosiahWI 2024-09-02 07:50:30 -05:00 committed by GitHub
parent 8972c80d7d
commit ac11a14509
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 2863 additions and 28 deletions

6
lib/tiniergltf/.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
cmake
CMakeCache.txt
CMakeFiles
.cache
compile_commands.json
build

View file

@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.12)
project(tiniergltf
VERSION 1.0.0
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(tiniergltf OBJECT tiniergltf.hpp)
add_library(tiniergltf::tiniergltf ALIAS tiniergltf)
set_target_properties(tiniergltf PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(tiniergltf
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"${JSON_INCLUDE_DIR}" # Set in FindJson.cmake
"${CMAKE_SOURCE_DIR}/src" # util/base64.h
)
target_link_libraries(tiniergltf)

39
lib/tiniergltf/Readme.md Normal file
View file

@ -0,0 +1,39 @@
# TinierGLTF
A safe, modern, tiny glTF loader for C++ 17.
What this is:
* A tiny glTF deserializer which maps JSON objects to appropriate C++ structures.
* Intended to be safe for loading untrusted input.
* Slightly tailored to the needs of [Minetest](https://github.com/minetest/minetest).
What this doesn't and shouldn't do:
* Serialization
* Loading images
* Resolving resources
* Support glTF extensions
## TODOs
- [ ] Add GLB support.
- [ ] Add further checks according to the specification.
- Everything in the JSON schema (+ indices and misc. stuff) is already validated.
Much of the code was generated by a Lua script from the JSON schemata.
## License
`tiniergltf.hpp` was written by Lars Müller and is licensed under the MIT license:
> Copyright 2024 Lars Müller
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Bug Bounty
I offer a reward of one (1) virtual headpat per valid bug report.

File diff suppressed because it is too large Load diff