removeInstanceAt method
Removes the instance at index. Instances after it shift down by
one, so their indices change.
Implementation
void removeInstanceAt(int index) {
final schema = _syncAttributeStorage();
if (schema != null) {
final floats = schema.floatCount;
final tail = (_instances.length - index - 1) * floats;
if (tail > 0) {
_attributeStore.setRange(
index * floats,
index * floats + tail,
_attributeStore,
(index + 1) * floats,
);
}
_attributeUsed -= floats;
_attributeView = null;
}
_instances.removeAt(index);
_colors.removeAt(index);
_windingFlipped.removeAt(index);
_boundsDirty = true;
_revision++;
}