updatePositions method

void updatePositions(
  1. Float32List positions
)

Replaces every vertex position, keeping the vertex count unchanged.

positions holds three floats per vertex and must match the current vertexCount. To change the vertex count, use rebuild. Throws a StateError unless this geometry is GeometryStorage.updatable.

Implementation

void updatePositions(Float32List positions) {
  _ensureUpdatable('updatePositions');
  _checkAttributeLength('positions', positions.length, 3);
  _cpuPositions = Float32List.fromList(positions);
  _uploadVertexBytes();
  _recomputeBounds();
}