init method
void
init()
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();
}