init method

void init(
  1. List<Vec3>? vertices,
  2. List<List<int>>? faces,
  3. List<Vec3?>? normals,
  4. List<Vec3>? axes,
  5. double? boundingSphereRadius,
)

Implementation

void init(
  List<Vec3>?  vertices,
  List<List<int>>? faces,
  List<Vec3?>? normals,
  List<Vec3>? axes,
  double? boundingSphereRadius
){
  //const { vertices = [], faces = [], normals = [], axes, boundingSphereRadius } = props
  this.vertices = vertices ?? [];
  faceNormals = normals ?? [];
  this.faces = faces ?? [];
  if (faceNormals.isEmpty) {
    computeNormals();
  }
  if (boundingSphereRadius == null) {
    updateBoundingSphereRadius();
  } else {
    this.boundingSphereRadius = boundingSphereRadius;
  }

  worldVertices = []; // World transformed version of .vertices
  worldVerticesNeedsUpdate = true;
  worldFaceNormals = []; // World transformed version of .faceNormals
  worldFaceNormalsNeedsUpdate = true;
  uniqueAxes = axes;
  uniqueEdges = [];
  computeEdges();
}