computeWorldVertices method

void computeWorldVertices(
  1. Vec3 position,
  2. Quaternion quat
)

Updates .worldVertices and sets .worldVerticesNeedsUpdate to false.

Implementation

void computeWorldVertices(Vec3 position, Quaternion quat) {
  final int n = vertices.length;
  while (worldVertices.length < n) {
    worldVertices.add(Vec3());
  }

  final verts = vertices;
  //final worldVerts = worldVertices;
  for (int i = 0; i != n; i++) {
    quat.vmult(verts[i], worldVertices[i]);
    position.vadd(worldVertices[i], worldVertices[i]);
  }

  worldVerticesNeedsUpdate = false;
}