RectAreaLightHelper constructor

RectAreaLightHelper(
  1. RectAreaLight light, [
  2. Color? color
])

light -- The light being visualized.

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

Implementation

factory RectAreaLightHelper(RectAreaLight light, [Color? color]) {

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

		final geometry = BufferGeometry();
		geometry.setAttributeFromString( 'position', Float32BufferAttribute.fromList(positions, 3 ) );
		geometry.computeBoundingSphere();

		final material = LineBasicMaterial.fromMap( { '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 ];

		final geometry2 = BufferGeometry();
		geometry2.setAttributeFromString( 'position', Float32BufferAttribute.fromList(positions2, 3 ) );
		geometry2.computeBoundingSphere();

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

  return instance;
	}