Skip to content

Commit ab82911

Browse files
RanPixtillppcareeokiIntegratedQuantum
authored
Load entity meshes from gltf/glb files (#2762)
Requires #2733 and #2680 Progress towards #2419 and #87 progress towards #2777 fixes #2830 So far only works in blockbench coordinate system (right handed, y-up, z-forward) converting it to our system, so for now you have to be sure you export your mesh in the right system if its from another program. Doesn't load textures so they are still stored in game assets. This is a really simple start that i will build up on in future PRs. A few questions still remain: - ~~Do we want to keep the legacy .obj loading?~~ (no, because in a later pr when i add joints i wont be able to add them and it will brake stuff, and thats generally useless) - ~~Do we want to load the file data ourselves and then feed it into the cgltf or just let cgltf handle that~~ (turns out there is no problem with that so its best to do that so that we can have local allocations) - Do we want to override cgltf allocation functions? - ~~Do we want to try handle other possible edge cases that might happen when exporting from other applications? (like different coordinate systems and stuff)~~ (yes #2777) --------- Co-authored-by: till++ <tillplusplus@gmail.com> Co-authored-by: careeoki <122191047+careeoki@users.noreply.github.com> Co-authored-by: tillpp <tillpp@users.noreply.github.com> Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
1 parent b31cc69 commit ab82911

17 files changed

Lines changed: 226 additions & 1770 deletions

assets/cubyz/entityModels/cubert.zig.zon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.model = "cubyz:cubert",
33
.defaultTexture = "cubyz:cubert",
44
.height = 2,
5+
.coordinateSystem = .right_handed_z_up,
56
}

assets/cubyz/entityModels/missing.zig.zon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.model = "cubyz:missing",
33
.defaultTexture = "cubyz:missing",
44
.height = 1,
5+
.coordinateSystem = .right_handed_y_up,
56
}
11.8 KB
Binary file not shown.

assets/cubyz/entityModels/models/cubert.obj

Lines changed: 0 additions & 381 deletions
This file was deleted.
1.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)