fromMeshOld static method

CSG fromMeshOld(
  1. Mesh mesh, [
  2. int? objectIndex
])

Implementation

static CSG fromMeshOld(Mesh mesh, [int? objectIndex]) {
  final tmpm3 = Matrix3.identity();
  final csg = CSG.fromGeometryOld(mesh.geometry!, objectIndex);
  tmpm3.getNormalMatrix(mesh.matrix);
  for (int i = 0; i < csg.polygons.length; i++) {
    final p = csg.polygons[i];
    for (int j = 0; j < p.vertices.length; j++) {
      final v = p.vertices[j];
      v.position.setFrom(Vector3().setFrom(v.position).applyMatrix4(mesh.matrix));
      v.normal.setFrom(Vector3().setFrom(v.normal).applyMatrix3(tmpm3));
    }
  }
  return csg;
}