TransformBatch GetOrAddBatch(int batchId) { while (batchId >= transformBatches.Count) { transformBatches.Add(TransformBatch.Create()); } return(transformBatches[batchId]); }
public void Add(Matrix4x4 m) { TransformBatch batch = GetOrAddBatch(currentBatchIndex); if (batch.IsFull()) { currentBatchIndex++; batch = GetOrAddBatch(currentBatchIndex); } batch.Add(m); }