Light

类位于 Infernux.components.builtin

继承自: BuiltinComponent

描述

为场景提供照明的光源组件。

description

属性

名称 类型 描述
light_type int 光源类型(0=方向光,1=点光源,2=聚光灯)。
color List[float] 光源颜色(RGB)。
intensity float 光源强度。
range float 点光源或聚光灯的照射范围。
spot_angle float 聚光灯的锥角(度)。
outer_spot_angle float The outer cone angle of the spot light in degrees.
shadows int The shadow casting mode of the light.
shadow_strength float 阴影强度。
shadow_bias float 阴影偏移量。

properties

公共方法

方法 描述
get_light_view_matrix() → Any Return the light's view matrix for shadow mapping.
get_light_projection_matrix(shadow_extent: float = ..., near_plane: float = ..., far_plane: float = ...) → Any Return the light's projection matrix for shadow mapping.
serialize() → str Serialize the component to a JSON string.

public_methods

生命周期方法

方法 描述
on_draw_gizmos_selected() → None Draw a type-specific gizmo when the light is selected.

lifecycle_methods

示例

example

# TODO: Add example for Light

另请参阅

see_also