class_gltflight.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/modules/gltf/doc_classes/GLTFLight.xml.
  6. .. _class_GLTFLight:
  7. GLTFLight
  8. =========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :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. \ **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to **GLTFLight** within a script will cause an error in an exported project.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  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:`float<class_float>` | :ref:`outer_cone_angle<class_GLTFLight_property_outer_cone_angle>` | ``0.785398`` |
  33. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  34. | :ref:`float<class_float>` | :ref:`range<class_GLTFLight_property_range>` | ``inf`` |
  35. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  36. | :ref:`String<class_String>` | :ref:`type<class_GLTFLight_property_type>` | ``""`` |
  37. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  38. .. rst-class:: classref-reftable-group
  39. Methods
  40. -------
  41. .. table::
  42. :widths: auto
  43. +-------------------------------------+--------------------------------------------------------------------------------+
  44. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFLight_method_to_dictionary>` **(** **)** |const| |
  45. +-------------------------------------+--------------------------------------------------------------------------------+
  46. | :ref:`Light<class_Light>` | :ref:`to_node<class_GLTFLight_method_to_node>` **(** **)** |const| |
  47. +-------------------------------------+--------------------------------------------------------------------------------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Property Descriptions
  52. ---------------------
  53. .. _class_GLTFLight_property_color:
  54. .. rst-class:: classref-property
  55. :ref:`Color<class_Color>` **color** = ``Color( 1, 1, 1, 1 )``
  56. .. rst-class:: classref-property-setget
  57. - void **set_color** **(** :ref:`Color<class_Color>` value **)**
  58. - :ref:`Color<class_Color>` **get_color** **(** **)**
  59. The :ref:`Color<class_Color>` of the light. Defaults to white. A black color causes the light to have no effect.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_GLTFLight_property_inner_cone_angle:
  63. .. rst-class:: classref-property
  64. :ref:`float<class_float>` **inner_cone_angle** = ``0.0``
  65. .. rst-class:: classref-property-setget
  66. - void **set_inner_cone_angle** **(** :ref:`float<class_float>` value **)**
  67. - :ref:`float<class_float>` **get_inner_cone_angle** **(** **)**
  68. The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
  69. 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:`SpotLight<class_SpotLight>`, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_GLTFLight_property_intensity:
  73. .. rst-class:: classref-property
  74. :ref:`float<class_float>` **intensity** = ``1.0``
  75. .. rst-class:: classref-property-setget
  76. - void **set_intensity** **(** :ref:`float<class_float>` value **)**
  77. - :ref:`float<class_float>` **get_intensity** **(** **)**
  78. 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.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_GLTFLight_property_outer_cone_angle:
  82. .. rst-class:: classref-property
  83. :ref:`float<class_float>` **outer_cone_angle** = ``0.785398``
  84. .. rst-class:: classref-property-setget
  85. - void **set_outer_cone_angle** **(** :ref:`float<class_float>` value **)**
  86. - :ref:`float<class_float>` **get_outer_cone_angle** **(** **)**
  87. The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
  88. 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:`SpotLight<class_SpotLight>`, the outer cone angle is used as the angle of the spotlight.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_GLTFLight_property_range:
  92. .. rst-class:: classref-property
  93. :ref:`float<class_float>` **range** = ``inf``
  94. .. rst-class:: classref-property-setget
  95. - void **set_range** **(** :ref:`float<class_float>` value **)**
  96. - :ref:`float<class_float>` **get_range** **(** **)**
  97. 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.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_GLTFLight_property_type:
  101. .. rst-class:: classref-property
  102. :ref:`String<class_String>` **type** = ``""``
  103. .. rst-class:: classref-property-setget
  104. - void **set_type** **(** :ref:`String<class_String>` value **)**
  105. - :ref:`String<class_String>` **get_type** **(** **)**
  106. The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's :ref:`OmniLight<class_OmniLight>`, :ref:`SpotLight<class_SpotLight>`, and :ref:`DirectionalLight<class_DirectionalLight>` respectively.
  107. .. rst-class:: classref-section-separator
  108. ----
  109. .. rst-class:: classref-descriptions-group
  110. Method Descriptions
  111. -------------------
  112. .. _class_GLTFLight_method_to_dictionary:
  113. .. rst-class:: classref-method
  114. :ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
  115. Serializes this GLTFLight instance into a :ref:`Dictionary<class_Dictionary>`.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_GLTFLight_method_to_node:
  119. .. rst-class:: classref-method
  120. :ref:`Light<class_Light>` **to_node** **(** **)** |const|
  121. Converts this GLTFLight instance into a Godot :ref:`Light<class_Light>` node.
  122. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  123. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  124. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  125. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`