class_gltflight.rst 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the GLTFLight.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_GLTFLight:
  6. GLTFLight
  7. =========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. Description
  10. -----------
  11. **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.
  12. Properties
  13. ----------
  14. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  15. | :ref:`Color<class_Color>` | :ref:`color<class_GLTFLight_property_color>` | ``Color( 1, 1, 1, 1 )`` |
  16. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  17. | :ref:`float<class_float>` | :ref:`inner_cone_angle<class_GLTFLight_property_inner_cone_angle>` | ``0.0`` |
  18. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  19. | :ref:`float<class_float>` | :ref:`intensity<class_GLTFLight_property_intensity>` | ``1.0`` |
  20. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  21. | :ref:`float<class_float>` | :ref:`outer_cone_angle<class_GLTFLight_property_outer_cone_angle>` | ``0.785398`` |
  22. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  23. | :ref:`float<class_float>` | :ref:`range<class_GLTFLight_property_range>` | ``inf`` |
  24. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  25. | :ref:`String<class_String>` | :ref:`type<class_GLTFLight_property_type>` | ``""`` |
  26. +-----------------------------+--------------------------------------------------------------------+-------------------------+
  27. Property Descriptions
  28. ---------------------
  29. .. _class_GLTFLight_property_color:
  30. - :ref:`Color<class_Color>` **color**
  31. +-----------+-------------------------+
  32. | *Default* | ``Color( 1, 1, 1, 1 )`` |
  33. +-----------+-------------------------+
  34. | *Setter* | set_color(value) |
  35. +-----------+-------------------------+
  36. | *Getter* | get_color() |
  37. +-----------+-------------------------+
  38. The :ref:`Color<class_Color>` of the light. Defaults to white. A black color causes the light to have no effect.
  39. ----
  40. .. _class_GLTFLight_property_inner_cone_angle:
  41. - :ref:`float<class_float>` **inner_cone_angle**
  42. +-----------+-----------------------------+
  43. | *Default* | ``0.0`` |
  44. +-----------+-----------------------------+
  45. | *Setter* | set_inner_cone_angle(value) |
  46. +-----------+-----------------------------+
  47. | *Getter* | get_inner_cone_angle() |
  48. +-----------+-----------------------------+
  49. The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
  50. 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.
  51. ----
  52. .. _class_GLTFLight_property_intensity:
  53. - :ref:`float<class_float>` **intensity**
  54. +-----------+----------------------+
  55. | *Default* | ``1.0`` |
  56. +-----------+----------------------+
  57. | *Setter* | set_intensity(value) |
  58. +-----------+----------------------+
  59. | *Getter* | get_intensity() |
  60. +-----------+----------------------+
  61. 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.
  62. ----
  63. .. _class_GLTFLight_property_outer_cone_angle:
  64. - :ref:`float<class_float>` **outer_cone_angle**
  65. +-----------+-----------------------------+
  66. | *Default* | ``0.785398`` |
  67. +-----------+-----------------------------+
  68. | *Setter* | set_outer_cone_angle(value) |
  69. +-----------+-----------------------------+
  70. | *Getter* | get_outer_cone_angle() |
  71. +-----------+-----------------------------+
  72. The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
  73. 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.
  74. ----
  75. .. _class_GLTFLight_property_range:
  76. - :ref:`float<class_float>` **range**
  77. +-----------+------------------+
  78. | *Default* | ``inf`` |
  79. +-----------+------------------+
  80. | *Setter* | set_range(value) |
  81. +-----------+------------------+
  82. | *Getter* | get_range() |
  83. +-----------+------------------+
  84. 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.
  85. ----
  86. .. _class_GLTFLight_property_type:
  87. - :ref:`String<class_String>` **type**
  88. +-----------+-----------------+
  89. | *Default* | ``""`` |
  90. +-----------+-----------------+
  91. | *Setter* | set_type(value) |
  92. +-----------+-----------------+
  93. | *Getter* | get_type() |
  94. +-----------+-----------------+
  95. 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.
  96. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  97. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  98. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`