RectAreaLight
平面光光源(RectAreaLight)继承自Light
平面光光源从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。
注意事项:
- 不支持阴影。
- 只支持 MeshStandardMaterial 和 MeshPhysicalMaterial 两种材质。
- 你必须在你的场景中加入 RectAreaLightUniformsLib,并调用
init()。
1.构造函数
js
RectAreaLight( color : Color, intensity : Float, width : Float, height : Float )参数:
- color -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 Color 对象。
- intensity -(可选)光源强度/亮度 。默认值为 1。
- width -(可选)光源宽度。默认值为 10。
- height -(可选)光源高度。默认值为 10。
2.属性
公共属性请查看基类 Light。
height
类型:Float
光源高度。
intensity
类型:Float
光源的强度。默认值为 1。 单位是尼特(cd/m^2)。
改变该值会影响到 power 的值。
isRectAreaLight
类型:Boolean
只读,用于检查对象的类型是否为 RectAreaLight。
power
类型:Float
光源的功率。 单位为流明(lm)。
改变该值会影响到 intensity 的值。
width
类型:Float
光源宽度。
3.方法
公共方法请查看基类 Light。
copy
将所有属性的值从源 source 复制到此平面光光源对象。
js
copy(source: RectAreaLight): this参数:
- source:一个平面光对象
返回值:返回调用对象本身
