generateVertexPositions method

  1. @override
void generateVertexPositions (Vector3List positions, Uint16List indices)
override

Implementation

@override
void generateVertexPositions(Vector3List positions, Uint16List indices) {
  // Front
  positions[0] = new Vector3(_width, _height, _depth);
  positions[1] = new Vector3(-_width, _height, _depth);
  positions[2] = new Vector3(-_width, -_height, _depth);
  positions[3] = new Vector3(_width, -_height, _depth);

  // Back
  positions[4] = new Vector3(_width, -_height, -_depth);
  positions[5] = new Vector3(-_width, -_height, -_depth);
  positions[6] = new Vector3(-_width, _height, -_depth);
  positions[7] = new Vector3(_width, _height, -_depth);

  // Right
  positions[8] = new Vector3(_width, -_height, _depth);
  positions[9] = new Vector3(_width, -_height, -_depth);
  positions[10] = new Vector3(_width, _height, -_depth);
  positions[11] = new Vector3(_width, _height, _depth);

  // Left
  positions[12] = new Vector3(-_width, _height, _depth);
  positions[13] = new Vector3(-_width, _height, -_depth);
  positions[14] = new Vector3(-_width, -_height, -_depth);
  positions[15] = new Vector3(-_width, -_height, _depth);

  // Top
  positions[16] = new Vector3(_width, _height, _depth);
  positions[17] = new Vector3(_width, _height, -_depth);
  positions[18] = new Vector3(-_width, _height, -_depth);
  positions[19] = new Vector3(-_width, _height, _depth);

  // Bottom
  positions[20] = new Vector3(-_width, -_height, _depth);
  positions[21] = new Vector3(-_width, -_height, -_depth);
  positions[22] = new Vector3(_width, -_height, -_depth);
  positions[23] = new Vector3(_width, -_height, _depth);
}