RectAreaLightHelper constructor

RectAreaLightHelper(
  1. dynamic light,
  2. dynamic color
)

Implementation

factory RectAreaLightHelper(light, color) {
  List<double> positions = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0];

  var geometry = BufferGeometry();
  geometry.setAttribute('position', Float32BufferAttribute(Float32Array.fromList(positions), 3));
  geometry.computeBoundingSphere();

  var material = LineBasicMaterial({'fog': false});

  final instance = RectAreaLightHelper.create(geometry, material);

  instance.light = light;
  instance.color = color; // optional hardwired color for the helper
  instance.type = 'RectAreaLightHelper';

  //

  List<double> positions2 = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0];

  var geometry2 = BufferGeometry();
  geometry2.setAttribute('position', Float32BufferAttribute(Float32Array.fromList(positions2), 3));
  geometry2.computeBoundingSphere();

  instance.add(Mesh(geometry2, MeshBasicMaterial({'side': BackSide, 'fog': false})));

  return instance;
}