mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
277 lines
12 KiB
ReStructuredText
277 lines
12 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. DO NOT EDIT THIS FILE!!!
|
||
.. Generated automatically from Godot engine sources.
|
||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/gltf/doc_classes/GLTFLight.xml.
|
||
|
||
.. _class_GLTFLight:
|
||
|
||
GLTFLight
|
||
=========
|
||
|
||
**继承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
代表 GLTF 灯光。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
代表由 ``KHR_lights_punctual`` GLTF 扩展定义的灯光。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教程
|
||
----
|
||
|
||
- :doc:`运行时文件加载与保存 <../tutorials/io/runtime_file_loading_and_saving>`
|
||
|
||
- `KHR_lights_punctual GLTF 扩展规格 <https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual>`__
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`color<class_GLTFLight_property_color>` | ``Color(1, 1, 1, 1)`` |
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
| :ref:`float<class_float>` | :ref:`inner_cone_angle<class_GLTFLight_property_inner_cone_angle>` | ``0.0`` |
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
| :ref:`float<class_float>` | :ref:`intensity<class_GLTFLight_property_intensity>` | ``1.0`` |
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
| :ref:`String<class_String>` | :ref:`light_type<class_GLTFLight_property_light_type>` | ``""`` |
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
| :ref:`float<class_float>` | :ref:`outer_cone_angle<class_GLTFLight_property_outer_cone_angle>` | ``0.785398`` |
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
| :ref:`float<class_float>` | :ref:`range<class_GLTFLight_property_range>` | ``inf`` |
|
||
+-----------------------------+--------------------------------------------------------------------+-----------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`GLTFLight<class_GLTFLight>` | :ref:`from_dictionary<class_GLTFLight_method_from_dictionary>`\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| |
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`GLTFLight<class_GLTFLight>` | :ref:`from_node<class_GLTFLight_method_from_node>`\ (\ light_node\: :ref:`Light3D<class_Light3D>`\ ) |static| |
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`get_additional_data<class_GLTFLight_method_get_additional_data>`\ (\ extension_name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_additional_data<class_GLTFLight_method_set_additional_data>`\ (\ extension_name\: :ref:`StringName<class_StringName>`, additional_data\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFLight_method_to_dictionary>`\ (\ ) |const| |
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Light3D<class_Light3D>` | :ref:`to_node<class_GLTFLight_method_to_node>`\ (\ ) |const| |
|
||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_GLTFLight_property_color:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Color<class_Color>` **color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_GLTFLight_property_color>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_color**\ (\ value\: :ref:`Color<class_Color>`\ )
|
||
- :ref:`Color<class_Color>` **get_color**\ (\ )
|
||
|
||
灯的 :ref:`Color<class_Color>`\ 。默认为白色。黑色会导致灯光无效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_property_inner_cone_angle:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **inner_cone_angle** = ``0.0`` :ref:`🔗<class_GLTFLight_property_inner_cone_angle>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_inner_cone_angle**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_inner_cone_angle**\ (\ )
|
||
|
||
聚光灯下圆锥体的内角。必须小于等于外锥角。
|
||
|
||
在这个角度内,光线处于全亮状态。在内锥角和外锥角之间,存在一个从全亮度到零亮度的过渡。创建 Godot :ref:`SpotLight3D<class_SpotLight3D>` 时,内外锥角之间的比率将被来计算光的衰减。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_property_intensity:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **intensity** = ``1.0`` :ref:`🔗<class_GLTFLight_property_intensity>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_intensity**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_intensity**\ (\ )
|
||
|
||
光的强度。对于点光和聚光,用烛光(流明/立体光)表示;对于平行光,用勒克斯(流明/平方米)表示。在创建 Godot 灯光时,这个值会被转换为无单位的乘数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_property_light_type:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **light_type** = ``""`` :ref:`🔗<class_GLTFLight_property_light_type>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_light_type**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_light_type**\ (\ )
|
||
|
||
灯光的类型。Godot接受的值有“point”、“spot”、“directional”,分别对应 Godot 的 :ref:`OmniLight3D<class_OmniLight3D>`\ 、\ :ref:`SpotLight3D<class_SpotLight3D>`\ 、\ :ref:`DirectionalLight3D<class_DirectionalLight3D>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_property_outer_cone_angle:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **outer_cone_angle** = ``0.785398`` :ref:`🔗<class_GLTFLight_property_outer_cone_angle>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_outer_cone_angle**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_outer_cone_angle**\ (\ )
|
||
|
||
聚光灯下圆锥体的外角。必须大于等于内锥角。
|
||
|
||
在这个角度,光线会下降到零亮度。在内锥角和外锥角之间,存在一个从全亮度到零亮度的过渡。如果这个角度是一个半圆,那么聚光灯会向所有方向发射。创建一个 Godot :ref:`SpotLight3D<class_SpotLight3D>` 时,外锥角被用作聚光灯的角度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_property_range:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **range** = ``inf`` :ref:`🔗<class_GLTFLight_property_range>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_range**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_range**\ (\ )
|
||
|
||
灯光的范围,超过这个范围灯光无效。没有定义范围的 GLTF 灯光的行为与无限范围的物理灯光一样。当创建 Godot 灯光时,范围限制在 4096。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_GLTFLight_method_from_dictionary:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`GLTFLight<class_GLTFLight>` **from_dictionary**\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| :ref:`🔗<class_GLTFLight_method_from_dictionary>`
|
||
|
||
通过解析给定的 :ref:`Dictionary<class_Dictionary>` 新建 GLTFLight 实例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_method_from_node:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`GLTFLight<class_GLTFLight>` **from_node**\ (\ light_node\: :ref:`Light3D<class_Light3D>`\ ) |static| :ref:`🔗<class_GLTFLight_method_from_node>`
|
||
|
||
从给定的 Godot :ref:`Light3D<class_Light3D>` 节点新建 GLTFLight 实例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_method_get_additional_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **get_additional_data**\ (\ extension_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_GLTFLight_method_get_additional_data>`
|
||
|
||
.. container:: contribute
|
||
|
||
该方法目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_method_set_additional_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_additional_data**\ (\ extension_name\: :ref:`StringName<class_StringName>`, additional_data\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_GLTFLight_method_set_additional_data>`
|
||
|
||
.. container:: contribute
|
||
|
||
该方法目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_method_to_dictionary:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **to_dictionary**\ (\ ) |const| :ref:`🔗<class_GLTFLight_method_to_dictionary>`
|
||
|
||
将这个 GLTFLight 实例序列化为 :ref:`Dictionary<class_Dictionary>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GLTFLight_method_to_node:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Light3D<class_Light3D>` **to_node**\ (\ ) |const| :ref:`🔗<class_GLTFLight_method_to_node>`
|
||
|
||
将这个 GLTFLight 实例转换为 Godot :ref:`Light3D<class_Light3D>` 节点。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|