jak-project/goalc/build_level/common
Hat Kid c64eea6337
[buildactor] support generating collide-meshes for custom models (#3540)
This adds support for generating collide meshes when importing custom
models. A couple of things to keep in mind:

- A single `collide-mesh` may only have up to 255 vertices.
- When exporting a GLTF file in Blender, a `collide-mesh` will be
generated for every mesh object that has collision properties applied
(ideally, you would set all visual meshes to `ignore` and your collision
meshes to `invisible` in the OpenGOAL plugin's custom properties).
- Ensure that your actor using the model properly allocates enough
`collide-shape-prim-mesh`es for each `collide-mesh` ([example from the
original game that uses multiple
meshes](f6688659f2/goal_src/jak1/levels/finalboss/robotboss.gc (L2628-L2806))).

~One annoying problem that I haven't fully figured out yet (unrelated to
the actual functionality):
`collide-mesh`es are stored in art groups as an `(array collide-mesh)`
in the `art-joint-geo`'s `extra`, so I had to add a new `Res` type to
support this. The way that `array`s are stored in `res-lump`s is a bit
of a hack right now. The lump only stores a pointer to the array, so the
size of that is 4 bytes, but because we have to generate all the actual
array data too, the current `ResLump` code in C++ doesn't handle this
case well and would assert, so I decided to omit the asserts if an
`array` tag is present and "fake" the size so the object file is
generated more closely to how the game expects it until we figure out
something better.~
This was fixed by generating the array data beforehand and creating a
`ResRef` class that takes the pointer to the array data and adds it to
the lump.
2024-05-29 06:09:20 +02:00
..
build_level.cpp [wip] build actor tool (#3266) 2024-05-18 18:18:25 +02:00
build_level.h [wip] build actor tool (#3266) 2024-05-18 18:18:25 +02:00
color_quantization.cpp custom levels: refactor level building code and jak 2 support (#3090) 2023-10-21 06:07:43 +02:00
color_quantization.h custom levels: refactor level building code and jak 2 support (#3090) 2023-10-21 06:07:43 +02:00
Entity.cpp custom levels: add support for symbol, type, and string lumps (#3337) 2024-01-25 23:20:32 +01:00
Entity.h custom levels: enum lump support (#3305) 2024-01-15 12:46:42 +01:00
FileInfo.cpp custom levels: refactor level building code and jak 2 support (#3090) 2023-10-21 06:07:43 +02:00
FileInfo.h custom levels: refactor level building code and jak 2 support (#3090) 2023-10-21 06:07:43 +02:00
gltf_mesh_extract.cpp [buildactor] support generating collide-meshes for custom models (#3540) 2024-05-29 06:09:20 +02:00
gltf_mesh_extract.h [buildactor] support generating collide-meshes for custom models (#3540) 2024-05-29 06:09:20 +02:00
ResLump.cpp [buildactor] support generating collide-meshes for custom models (#3540) 2024-05-29 06:09:20 +02:00
ResLump.h [buildactor] support generating collide-meshes for custom models (#3540) 2024-05-29 06:09:20 +02:00
Tfrag.cpp Add hfrag, clean up some background renderer stuff (#3509) 2024-05-09 20:11:43 -04:00
Tfrag.h [wip] build actor tool (#3266) 2024-05-18 18:18:25 +02:00