GLTFLight

继承: Resource < RefCounted < Object

Represents a glTF light.

描述

Represents a light as defined by the KHR_lights_punctual glTF extension.

属性

方法

GLTFLightfrom_dictionary ( dictionary: Dictionary ) static1
GLTFLightfrom_node ( light_node: Light3D ) static1
Variantget_additional_data ( extension_name: StringName )
voidset_additional_data ( extension_name: StringName, additional_data: Variant )
Dictionaryto_dictionary ( ) const2
Light3Dto_node ( ) const2

属性说明

Color color = Color(1, 1, 1, 1)

  • void set_color ( value: Color )
  • Color get_color ( )

The Color of the light. Defaults to white. A black color causes the light to have no effect.


float inner_cone_angle = 0.0

  • void set_inner_cone_angle ( value: float )
  • float get_inner_cone_angle ( )

The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.

Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot SpotLight3D, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.


float intensity = 1.0

  • void set_intensity ( value: float )
  • float get_intensity ( )

The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier.


String light_type = ""

  • void set_light_type ( value: String )
  • String get_light_type ( )

The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.


float outer_cone_angle = 0.785398

  • void set_outer_cone_angle ( value: float )
  • float get_outer_cone_angle ( )

The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.

At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot SpotLight3D, the outer cone angle is used as the angle of the spotlight.


float range = inf

  • void set_range ( value: float )
  • float get_range ( )

The range of the light, beyond which the light has no effect. glTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096.


方法说明

GLTFLight from_dictionary ( dictionary: Dictionary ) static1

Creates a new GLTFLight instance by parsing the given Dictionary.


GLTFLight from_node ( light_node: Light3D ) static1

Create a new GLTFLight instance from the given Godot Light3D node.


Variant get_additional_data ( extension_name: StringName )

该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>\ 吧!


void set_additional_data ( extension_name: StringName, additional_data: Variant )

该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>\ 吧!


Dictionary to_dictionary ( ) const2

Serializes this GLTFLight instance into a Dictionary.


Light3D to_node ( ) const2

Converts this GLTFLight instance into a Godot Light3D node.

3

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

4

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

5

本方法用于构造某个类型。

1

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。