- Add World:getColliderCount
- Add World:getJointCount
- Add World:getJoints
- Add Joint:isDestroyed
- Destroy joints when either of their colliders are destroyed (Jolt
seems to require this).
- Fix joint memory leak.
- Change joints to be stored in some crazy graph thing.
- Reduces allocations, allows constant time insertion/removal.
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.
They still work on ODE, and Jolt makes a best-effort attempt to support
them, but they will be removed in a future version.
- Damping should be set explicitly on colliders.
- Tightness and response time will be supported via spring forces, and
also some global settings in newWorld will affect joints too.
- Step count will be added to :update soon. Since the correct value is
dt-dependent in Jolt, a persistent accessor doesn't make sense.
- Sleeping allowed will be an immutable setting in newWorld soon, but
otherwise should be changed per-collider.
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.
LÖVR uses d32f by default, but that's not guaranteed to be supported.
However, GPUs must support either d32f or d24, so we can fall back to
d24 reliably.