class_gltflight.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/gltf/doc_classes/GLTFLight.xml.
  6. .. _class_GLTFLight:
  7. GLTFLight
  8. =========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Represents a glTF light.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Represents a light as defined by the ``KHR_lights_punctual`` glTF extension.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  19. - `KHR_lights_punctual glTF extension spec <https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual>`__
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  26. | :ref:`Color<class_Color>` | :ref:`color<class_GLTFLight_property_color>` | ``Color(1, 1, 1, 1)`` |
  27. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  28. | :ref:`float<class_float>` | :ref:`inner_cone_angle<class_GLTFLight_property_inner_cone_angle>` | ``0.0`` |
  29. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  30. | :ref:`float<class_float>` | :ref:`intensity<class_GLTFLight_property_intensity>` | ``1.0`` |
  31. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  32. | :ref:`String<class_String>` | :ref:`light_type<class_GLTFLight_property_light_type>` | ``""`` |
  33. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  34. | :ref:`float<class_float>` | :ref:`outer_cone_angle<class_GLTFLight_property_outer_cone_angle>` | ``0.7853982`` |
  35. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  36. | :ref:`float<class_float>` | :ref:`range<class_GLTFLight_property_range>` | ``inf`` |
  37. +-----------------------------+--------------------------------------------------------------------+-----------------------+
  38. .. rst-class:: classref-reftable-group
  39. Methods
  40. -------
  41. .. table::
  42. :widths: auto
  43. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`GLTFLight<class_GLTFLight>` | :ref:`from_dictionary<class_GLTFLight_method_from_dictionary>`\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| |
  45. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`GLTFLight<class_GLTFLight>` | :ref:`from_node<class_GLTFLight_method_from_node>`\ (\ light_node\: :ref:`Light3D<class_Light3D>`\ ) |static| |
  47. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Variant<class_Variant>` | :ref:`get_additional_data<class_GLTFLight_method_get_additional_data>`\ (\ extension_name\: :ref:`StringName<class_StringName>`\ ) |
  49. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | |void| | :ref:`set_additional_data<class_GLTFLight_method_set_additional_data>`\ (\ extension_name\: :ref:`StringName<class_StringName>`, additional_data\: :ref:`Variant<class_Variant>`\ ) |
  51. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFLight_method_to_dictionary>`\ (\ ) |const| |
  53. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Light3D<class_Light3D>` | :ref:`to_node<class_GLTFLight_method_to_node>`\ (\ ) |const| |
  55. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. .. rst-class:: classref-section-separator
  57. ----
  58. .. rst-class:: classref-descriptions-group
  59. Property Descriptions
  60. ---------------------
  61. .. _class_GLTFLight_property_color:
  62. .. rst-class:: classref-property
  63. :ref:`Color<class_Color>` **color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_GLTFLight_property_color>`
  64. .. rst-class:: classref-property-setget
  65. - |void| **set_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  66. - :ref:`Color<class_Color>` **get_color**\ (\ )
  67. The :ref:`Color<class_Color>` of the light in linear space. Defaults to white. A black color causes the light to have no effect.
  68. This value is linear to match glTF, but will be converted to nonlinear sRGB when creating a Godot :ref:`Light3D<class_Light3D>` node upon import, or converted to linear when exporting a Godot :ref:`Light3D<class_Light3D>` to glTF.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_GLTFLight_property_inner_cone_angle:
  72. .. rst-class:: classref-property
  73. :ref:`float<class_float>` **inner_cone_angle** = ``0.0`` :ref:`🔗<class_GLTFLight_property_inner_cone_angle>`
  74. .. rst-class:: classref-property-setget
  75. - |void| **set_inner_cone_angle**\ (\ value\: :ref:`float<class_float>`\ )
  76. - :ref:`float<class_float>` **get_inner_cone_angle**\ (\ )
  77. The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
  78. 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 :ref:`SpotLight3D<class_SpotLight3D>`, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_GLTFLight_property_intensity:
  82. .. rst-class:: classref-property
  83. :ref:`float<class_float>` **intensity** = ``1.0`` :ref:`🔗<class_GLTFLight_property_intensity>`
  84. .. rst-class:: classref-property-setget
  85. - |void| **set_intensity**\ (\ value\: :ref:`float<class_float>`\ )
  86. - :ref:`float<class_float>` **get_intensity**\ (\ )
  87. 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.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_GLTFLight_property_light_type:
  91. .. rst-class:: classref-property
  92. :ref:`String<class_String>` **light_type** = ``""`` :ref:`🔗<class_GLTFLight_property_light_type>`
  93. .. rst-class:: classref-property-setget
  94. - |void| **set_light_type**\ (\ value\: :ref:`String<class_String>`\ )
  95. - :ref:`String<class_String>` **get_light_type**\ (\ )
  96. The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's :ref:`OmniLight3D<class_OmniLight3D>`, :ref:`SpotLight3D<class_SpotLight3D>`, and :ref:`DirectionalLight3D<class_DirectionalLight3D>` respectively.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_GLTFLight_property_outer_cone_angle:
  100. .. rst-class:: classref-property
  101. :ref:`float<class_float>` **outer_cone_angle** = ``0.7853982`` :ref:`🔗<class_GLTFLight_property_outer_cone_angle>`
  102. .. rst-class:: classref-property-setget
  103. - |void| **set_outer_cone_angle**\ (\ value\: :ref:`float<class_float>`\ )
  104. - :ref:`float<class_float>` **get_outer_cone_angle**\ (\ )
  105. The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
  106. 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 :ref:`SpotLight3D<class_SpotLight3D>`, the outer cone angle is used as the angle of the spotlight.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_GLTFLight_property_range:
  110. .. rst-class:: classref-property
  111. :ref:`float<class_float>` **range** = ``inf`` :ref:`🔗<class_GLTFLight_property_range>`
  112. .. rst-class:: classref-property-setget
  113. - |void| **set_range**\ (\ value\: :ref:`float<class_float>`\ )
  114. - :ref:`float<class_float>` **get_range**\ (\ )
  115. 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.0``.
  116. .. rst-class:: classref-section-separator
  117. ----
  118. .. rst-class:: classref-descriptions-group
  119. Method Descriptions
  120. -------------------
  121. .. _class_GLTFLight_method_from_dictionary:
  122. .. rst-class:: classref-method
  123. :ref:`GLTFLight<class_GLTFLight>` **from_dictionary**\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| :ref:`🔗<class_GLTFLight_method_from_dictionary>`
  124. Creates a new GLTFLight instance by parsing the given :ref:`Dictionary<class_Dictionary>`.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_GLTFLight_method_from_node:
  128. .. rst-class:: classref-method
  129. :ref:`GLTFLight<class_GLTFLight>` **from_node**\ (\ light_node\: :ref:`Light3D<class_Light3D>`\ ) |static| :ref:`🔗<class_GLTFLight_method_from_node>`
  130. Create a new GLTFLight instance from the given Godot :ref:`Light3D<class_Light3D>` node.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_GLTFLight_method_get_additional_data:
  134. .. rst-class:: classref-method
  135. :ref:`Variant<class_Variant>` **get_additional_data**\ (\ extension_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_GLTFLight_method_get_additional_data>`
  136. .. container:: contribute
  137. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_GLTFLight_method_set_additional_data:
  141. .. rst-class:: classref-method
  142. |void| **set_additional_data**\ (\ extension_name\: :ref:`StringName<class_StringName>`, additional_data\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_GLTFLight_method_set_additional_data>`
  143. .. container:: contribute
  144. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_GLTFLight_method_to_dictionary:
  148. .. rst-class:: classref-method
  149. :ref:`Dictionary<class_Dictionary>` **to_dictionary**\ (\ ) |const| :ref:`🔗<class_GLTFLight_method_to_dictionary>`
  150. Serializes this GLTFLight instance into a :ref:`Dictionary<class_Dictionary>`.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_GLTFLight_method_to_node:
  154. .. rst-class:: classref-method
  155. :ref:`Light3D<class_Light3D>` **to_node**\ (\ ) |const| :ref:`🔗<class_GLTFLight_method_to_node>`
  156. Converts this GLTFLight instance into a Godot :ref:`Light3D<class_Light3D>` node.
  157. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  158. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  159. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  160. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  161. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  162. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  163. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  164. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  165. .. |void| replace:: :abbr:`void (No return value.)`