Commit Graph

11602 Commits

Author SHA1 Message Date
Josiah VanderZee c928cc8456 Put files in the right places 2024-04-18 12:00:03 -05:00
Josiah VanderZee 53233b7ab2 Fix rebase errors 2024-04-18 11:57:13 -05:00
Josiah VanderZee 1ca8a02269 Fix rebase mistakes in CMakeLists 2024-04-18 11:47:33 -05:00
Josiah VanderZee 6ebec708fe Move libs 2024-04-18 11:47:33 -05:00
Josiah VanderZee 3098194117 Move files 2024-04-18 11:47:33 -05:00
Lars Müller 5289d19a23 Fix gltf static mesh loading issues (#14)
* Support u8 / u32 indices

* Skip primitives without vertices

* Add support for non-indexed geometry & skipping primitives

* Fix possible memory leak on error

* Use SSkinnedMesh

* Check indices

* Properly mirror node hierarchy

* Update .gitignore

* Reorder includes

* Add some throws for logic errors

* Fix non-indexed geometry winding order, add unit test

* Address code review comments

* Add matrix transform unit test
2024-04-18 11:47:31 -05:00
Lars Müller ab18be967a Move from tinygltf to tiniergltf (#13)
* Remove tinygltf

* Integrate tiniergltf

* Update build.yml to include jsoncpp

* Namespace target

* Undo noexcept removal, readd move constructor

* Remove debug throw

* Remove now obsolete build code

* Bump CMake minimum version to 3.12

* Fix oops

* Remove unnecessary install/export

* Remove tinygltf from Config.cmake.in

* Take inspiration from Minetest's FindJson.cmake

* Move tiniergltf to separate repo

* CI: Install git

* Bump tiniergltf version (obtain jsoncpp via FetchContent)

* Remove jsoncpp from build dependency list
2024-04-18 11:47:10 -05:00
jordan4ibanez 2ddff13ab6 Fix getScale()
* Fix getScale()

* Create blender_cube_scaled.gltf

* Add scaling unit test

* Remove comment

* Undo github's silent reversion of 1,1,1
2024-04-18 11:46:36 -05:00
JosiahWI 584b809df2 Axe the minimum-cmake CI build
This is useful, but has no business being in this PR. Off with its head.
2024-04-18 11:46:36 -05:00
Lars Mueller 4d0c53aa83 Fix memory leak caused by missing `drop` 2024-04-18 11:46:36 -05:00
jordan4ibanez 725f202598 Package glTF spec docs with comments
* git --CRUSH

And try to make this line the same

Now undo my gitignore nonsense

Hail mary

Move these functions to the top

More documentation

Add some serious documentation

Move this to the top

Readability & documentation

Add some documentation

Add spec documentation

Make this more more complex to make it less complex

Move this up & document

Make this more readable for me

Document and make this more readable

Move this out of the way and document it

Update CGLTFMeshFileLoader.cpp

Documentation

Document

Update CGLTFMeshFileLoader.cpp

Document

Move entry point to bottom

Part 5

Part 4

Part 3

Part 2

Allman -> OTBS (readability for me)

Consolidate

Remove unneeded function

These files are annoying

* fix #1

* fix 2

* indentation

* Remove redundant function

* Remove redundant function

* add trailing new line

* Stop an interesting build error with a template

* Code reduction

* Document bytestride

* Add more detail to chain hierarchy

* Dump this huge vscode thing in here for no reason

* Document 3 more functions

* Document copyTcoords

* Dump in (incorrect) scale documentation for node

* Add a readable description

* Fix incorrect getScale

* Add update based on context of function

* Add documentation, fix another one

* Document another

* Document another

* And document another

* Document this nice function

* Bolt in some future use documentation

* Add highlighting for IDE

* Just shovel on more docs to this

* 2 more comments

* I think that's all of them

* Add some wild west debuggin

* And then update this comment

* Bolt on isAccessorNormalized()

* Bolt in an absolute hack job to test

* Now clean this mess up and give josiah ref material

* Fix Josiah's request for scale

* Fix josiah request

* Fix josiah request .vscode

Fix indentation

Fix indentation

Fix indentation

* Unfix getScale()

again
2024-04-18 11:46:36 -05:00
JosiahWI 9c21e2ec1b Handle byte stride on vertex buffers
Vertex buffers (and only vertex buffers) may have a byte stride
specified.
2024-04-18 11:46:36 -05:00
JosiahWI 7b0738784b Add operator<< definition for vector3d 2024-04-18 11:46:36 -05:00
JosiahWI 07e58e3d58 Do not install tinygltf export from Irrlicht 2024-04-18 11:46:36 -05:00
Josiah VanderZee 23d982b348 Borrow CReadFile for tests
The method to load a mesh from a file was removed. This is not a good
fix, but it will keep the tests working until a file loader can be
properly exposed to the tests.
2024-04-18 11:46:36 -05:00
JosiahWI ba61e081fc Print glTF loading issues to log 2024-04-18 11:46:36 -05:00
JosiahWI 5aa9f8dcf4 Refactor vertex loading 2024-04-18 11:46:36 -05:00
JosiahWI 311a176cf0 Extract loadPrimitives method from createMesh 2024-04-18 11:46:35 -05:00
JosiahWI f383dd3c84 Rename ModelParser to MeshExtractor 2024-04-18 11:46:35 -05:00
JosiahWI 84a556a723 Mark ModelParser constructors noexcept 2024-04-18 11:46:35 -05:00
JosiahWI bd07af3ad4 Document readVec3DF and getScale 2024-04-18 11:46:35 -05:00
JosiahWI dc9928f978 Add const to numeric parameters 2024-04-18 11:46:35 -05:00
JosiahWI 18ebadc0ab Return vector from getVertices 2024-04-18 11:46:35 -05:00
JosiahWI 3d2a3f4701 Refactor getIndices() 2024-04-18 11:46:35 -05:00
JosiahWI 8747734766 Document coordinate system change at top of source 2024-04-18 11:46:35 -05:00
JosiahWI f1867fd045 Convert snake_case variable names to camelCase 2024-04-18 11:46:35 -05:00
JosiahWI 0d7bcc90bb Add r-value reference constructor to ModelParser 2024-04-18 11:46:35 -05:00
JosiahWI 420742f856 Fix function declaration indents 2024-04-18 11:46:35 -05:00
JosiahWI 9e6c8fa80c Move parsing methods into ModelParser class 2024-04-18 11:46:35 -05:00
JosiahWI ca8d972982 Fix CMake tinygltf dependencies 2024-04-18 11:46:34 -05:00
JosiahWI f90f7817f6 Reorganize CGLTFMeshFileLoader help functions
I moved them all into static methods and changed the ordering in the
source file so that createMesh() would be close to the top of the file.
I also corrected formatting in some of the function declarations since I
had to change them anyway.
2024-04-18 11:46:21 -05:00
JosiahWI 797e6c1aa9 Restore path accidentally removed in 584a46f 2024-04-18 11:46:07 -05:00
JosiahWI f17cc741f4 Disable -Werror on minimum-cmake CI 2024-04-18 11:46:07 -05:00
JosiahWI 64fdf21b9d Set C compiler to gcc-5 for minimum-cmake CI
gcc-5 is already installed on the CI as a dependency for g++-5.
2024-04-18 11:46:07 -05:00
JosiahWI 0ce2b04fb3 Set C compiler to g++-5 on minimum-cmake CI 2024-04-18 11:46:07 -05:00
JosiahWI 2981f321d8 Fix indentation style in CMakeLists 2024-04-18 11:46:05 -05:00
JosiahWI 3e0a491cf4 Work around TestBigEndian bug in cmake<3.9 2024-04-18 11:45:16 -05:00
JosiahWI 6551a9604c Work around cmake<3.12 object target rules
CMake does not allow specifying usage requirements with
target_link_libraries() until version 3.12.
2024-04-18 11:44:49 -05:00
JosiahWI 4888c3b765 Remove unneeded tinygltf include from header 2024-04-18 11:44:31 -05:00
JosiahWI 3338cfac44 Clarify behavior of BUILD_TESTING option in README 2024-04-18 11:44:24 -05:00
JosiahWI dcff130333 Do not fail to load glTF because of warnings 2024-04-18 11:43:49 -05:00
JosiahWI e58e9d5c51 Mark CGLTFMeshFileLoader constructor as noexcept 2024-04-18 11:43:49 -05:00
JosiahWI 595e519cdf Register Catch2 tests with CTest 2024-04-18 11:43:48 -05:00
jordan4ibanez a73e6895d8 spaces->tabs 2024-04-18 11:42:07 -05:00
jordan4ibanez 5bad6e8a76 Update code with requested changes
Fix mistake on github

Comply with changes 1

Comply with requested changes 2

Comply with requested changed 3

Comply with requested changed 4

Requested changed 5

Requested changed 6

Requested changed 7

Requested changed 8

Requested changed 9

Requested changed 10

Requested changes 11

Requested changes 12

This one wasn't even requested

I just turned on my vertical ruler and I'm going to go nuts

Line 81 doesn't exist anymore

Requested changes 13

Requested changes 14

Begin snow man test

Write a lot of tests for snow man

Add to git ignore

Now unignore it

Alphabetical order

Pass by reference

Pass by reference

vertexBuffer is now handled on stack

Preallocate indicesBuffer then reverse it when complete

Undo vertexBuffer stack change causing mac builds to fail

Use direct initialization on the vertexBuffer
2024-04-18 11:42:07 -05:00
jordan4ibanez ee5f89ce56 Fix embedded textures causing a model not to load 2024-04-18 11:42:07 -05:00
jordan4ibanez 3c468352c7 Fix indices, inverted models, & multiple models failing to load
Fix embedded textures causing a model not to load

Add todo

Add another todo

Push current (broken) prototyping

Fix missing bracket

Make a single array object work

Convert hard array into dynamic vector

Simplify semantics

Remove "new"

Add blocker for vscode environment changes

Disable non-dynamic prototyping

Add comment

Add more informative debug & disable it

Add additional items to gitignore

Add debug info for scalar value

Output even more debug info

Make textures render correctly

Insert the indices properly

Update .gitignore

Disable y flip

Make a reusable vertex buffer :)

Disallow embedded textures

More disable

Set up implementation for contiguous model

Add a note

More automation & framework

Final framework before stepping into function overhaul

Hold track of current_index

Integrate iterators

More integration

Rename, it's going to need 2 counters

Correctly offset the count to the right

Sync normals with positions

Time to use a tuple

Set up other counters

Do return value

Do input passing

Make (somewhat) working contiguous model

Add getter for translation data

Add debug info for future utilization

Update .gitignore

More debug

Update .gitignore

Update .gitignore

Remove all debug info & clean up

Delete this thing

Automate everything & put it into spec

Spaces into tabs

Remove array include as build test

Fix the gitignore
2024-04-18 11:42:07 -05:00
Josiah VanderZee 9efbd9e262 Fix segfault from reading bad number of indices 2024-04-18 11:42:06 -05:00
Josiah VanderZee e08281497d Update to latest branch of lukka/get-cmake 2024-04-18 11:42:06 -05:00
Josiah VanderZee 5391f726dd Fix coordinate system change
Old code was inverting the X axis, new code inverts the Z axis.
2024-04-18 11:42:06 -05:00