If you create a StaticCompoundShape with 1 child, Jolt creates a
RotatedTranslatedShape. It would be a pain to have to branch on that,
so let's just require 2 children.
Jolt doesn't support this and requires you to recreate the shape. Since
the shape -> collider relationship is 1:N, we can't really create a new
shape because we'd have to figure out which colliders/compoundshapes to
assign it to, which isn't feasible.
refs are cumbersome because they require storing an int and they require
manual cleanup when the object is destroyed.
Instead, we'll go with a pure Lua solution using a table in the
registry. The table has weak keys containing the LÖVR object, and the
values are the userdata. This doesn't require any manual cleanup,
reduces the size of objects by 8 bytes, and is about 25% faster.
The new values come from comments in the official HelloWorld.cpp. After
the changes the any increase of memory consumption is within the
measurement error.