addInstance method
Adds an instance placed by transform and returns its index.
The matrix is copied, so later mutating transform does not affect
the instance; use setInstanceTransform to move it.
Implementation
int addInstance(Matrix4 transform) {
_instances.add(transform.clone());
_boundsDirty = true;
return _instances.length - 1;
}