boundsInto method

void boundsInto(
  1. int skin,
  2. Float32List nodeMatrices,
  3. Aabb3 out
)

Bounds, in model space, of everything skin skin can draw in the pose of nodeMatrices: its joints' positions, grown by the furthest any vertex sits from its joint.

Implementation

void boundsInto(int skin, Float32List nodeMatrices, Aabb3 out) {
  final joints = model.skins[skin].joints;
  final reach = _reach[skin];
  out.setEmpty();
  for (var j = 0; j < joints.length; j++) {
    final o = joints[j] * 16;
    final x = nodeMatrices[o + 12],
        y = nodeMatrices[o + 13],
        z = nodeMatrices[o + 14];
    final r = reach[j];
    out
      ..addXYZ(x - r, y - r, z - r)
      ..addXYZ(x + r, y + r, z + r);
  }
}