PointLightHelper constructor

PointLightHelper(
  1. PointLight light,
  2. double sphereSize, [
  3. int? color
])

light -- The light to be visualized.

sphereSize -- (optional) The size of the sphere helper. Default is 1.

color -- (optional) if this is not the set the helper will take the color of the light.

Implementation

factory PointLightHelper(PointLight light, double sphereSize, [int? color]) {
  final geometry = SphereGeometry(sphereSize, 4, 2);
  final material = MeshBasicMaterial.fromMap({"wireframe": true, "fog": false, "toneMapped": false});

  final plh = PointLightHelper.create(geometry, material);

  plh.light = light;
  plh.light.updateMatrixWorld(false);

  plh.color = color!=null?Color.fromHex32(color):null;
  plh.matrix = plh.light.matrixWorld;
  plh.matrixAutoUpdate = false;

  plh.update();
  return plh;
}