Closed lilleyse closed 4 months ago
Thanks @lilleyse! Some of this code is pretty old, written before we had really settled on best practices for integer conversions. So I snuck in some more changes:
int
with int32_t
.if (meshId >= 0 && meshId < static_cast<int32_t>(model.meshes.size()))
Do this:
if (meshId >= 0 && size_t(meshId) < model.meshes.size())
The former could reject valid indices in the (admittedly very unlikely) event that a model has more than 2^31 - 1 meshes.
I found myself needing a function like
forEachPrimitiveInScene
but without drilling into meshes / primitives and just traversing over nodes.