Class Info |
|---|
public class Light extends Component 灯光组件。 |
Qualifier and Type | Method Name and Description |
|---|---|
static Component.Descriptor<Light> | 获取灯光组件描述符。 |
getColor() 获取灯光颜色。 | |
float | 获取光照强度。 |
getType() 获取灯光类型。 | |
boolean | 获取灯光是否投射阴影。 |
setCastShadow(boolean enable) 设置是否投射阴影。 | |
| 设置灯光颜色。 | |
setInnerAndOuterCone(float inner, float outer) 设置聚光灯内外圈角度。 | |
setIntensity(float intensity) 设置光照强度。 | |
setType(Light.Type type) 设置灯光类型。 |
Method |
|---|
public static Component.Descriptor<Light> descriptor() 获取灯光组件描述符。 |
Returns
Type | Description |
|---|---|
灯光组件描述符。 |
Method |
|---|
public boolean isShadowCaster() 获取灯光是否投射阴影。 |
Returns
Type | Description |
|---|---|
boolean | 是否投射阴影。
|
Method |
|---|
public Light setCastShadow(boolean enable) 设置是否投射阴影。 |
Parameters
Name | Description |
|---|---|
enable | 是否投射阴影。
|
Returns
Type | Description |
|---|---|
自身实例。 |
Parameters
Name | Description |
|---|---|
color | 灯光的RGB颜色向量,R 、G、B的取值范围为[0, 1]。 |
Returns
Type | Description |
|---|---|
自身实例。 |
Method |
|---|
public Light setInnerAndOuterCone(float inner, float outer) 设置灯光内圈外圈角度。 |
Parameters
Name | Description |
|---|---|
inner | 内圈角度,取值范围[0, outer]。 |
outer | 外圈角度,取值范围[inner, 180]。 |
Returns
Type | Description |
|---|---|
自身实例。 |
Method |
|---|
public Light setIntensity(float intensity) 设置光照强度。 |
Parameters
Name | Description |
|---|---|
intensity | 光照强度,取值范围大于0。 |
Returns
Type | Description |
|---|---|
自身实例。 |
Method |
|---|
public Light setType(Light.Type type) 设置灯光类型。 |
Parameters
Name | Description |
|---|---|
type | 灯光类型,当前支持点光源、方向光与聚光灯。 |
Returns
Type | Description |
|---|---|
自身实例。 |