readBodies method
bodies' poses, in order, into out; dead ones read as zeros.
Implementation
@override
void readBodies(List<int> handles, BodyPoses3D out) {
final data = Float32List(handles.length * BodyPoses3D.stride);
for (var i = 0; i < handles.length; i++) {
final b = bodies[handles[i]];
if (b == null) continue;
final o = i * BodyPoses3D.stride;
data
..[o] = b.position.x
..[o + 1] = b.position.y
..[o + 2] = b.position.z
..[o + 3] = b.rotation.x
..[o + 4] = b.rotation.y
..[o + 5] = b.rotation.z
..[o + 6] = b.rotation.w
..[o + 7] = b.linearVelocity.x
..[o + 8] = b.linearVelocity.y
..[o + 9] = b.linearVelocity.z
..[o + 10] = b.angularVelocity.x
..[o + 11] = b.angularVelocity.y
..[o + 12] = b.angularVelocity.z
..[o + 13] = b.awake ? 1 : 0;
}
out.set(handles.length, List.of(handles), data);
}