class_gltfcamera.rst 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/modules/gltf/doc_classes/GLTFCamera.xml.
  6. .. _class_GLTFCamera:
  7. GLTFCamera
  8. ==========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Represents a GLTF camera.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Represents a camera as defined by the base GLTF spec.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - `GLTF camera detailed specification <https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-camera>`__
  19. - `GLTF camera spec and example file <https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_015_SimpleCameras.md>`__
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------+-----------------------------------------------------------+------------+
  26. | :ref:`float<class_float>` | :ref:`depth_far<class_GLTFCamera_property_depth_far>` | ``4000.0`` |
  27. +---------------------------+-----------------------------------------------------------+------------+
  28. | :ref:`float<class_float>` | :ref:`depth_near<class_GLTFCamera_property_depth_near>` | ``0.05`` |
  29. +---------------------------+-----------------------------------------------------------+------------+
  30. | :ref:`float<class_float>` | :ref:`fov<class_GLTFCamera_property_fov>` | ``1.309`` |
  31. +---------------------------+-----------------------------------------------------------+------------+
  32. | :ref:`bool<class_bool>` | :ref:`perspective<class_GLTFCamera_property_perspective>` | ``true`` |
  33. +---------------------------+-----------------------------------------------------------+------------+
  34. | :ref:`float<class_float>` | :ref:`size_mag<class_GLTFCamera_property_size_mag>` | ``0.5`` |
  35. +---------------------------+-----------------------------------------------------------+------------+
  36. .. rst-class:: classref-reftable-group
  37. Methods
  38. -------
  39. .. table::
  40. :widths: auto
  41. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`GLTFCamera<class_GLTFCamera>` | :ref:`from_dictionary<class_GLTFCamera_method_from_dictionary>` **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |static| |
  43. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`GLTFCamera<class_GLTFCamera>` | :ref:`from_node<class_GLTFCamera_method_from_node>` **(** :ref:`Camera3D<class_Camera3D>` camera_node **)** |static| |
  45. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFCamera_method_to_dictionary>` **(** **)** |const| |
  47. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Camera3D<class_Camera3D>` | :ref:`to_node<class_GLTFCamera_method_to_node>` **(** **)** |const| |
  49. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Property Descriptions
  54. ---------------------
  55. .. _class_GLTFCamera_property_depth_far:
  56. .. rst-class:: classref-property
  57. :ref:`float<class_float>` **depth_far** = ``4000.0``
  58. .. rst-class:: classref-property-setget
  59. - void **set_depth_far** **(** :ref:`float<class_float>` value **)**
  60. - :ref:`float<class_float>` **get_depth_far** **(** **)**
  61. The distance to the far culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF's ``zfar`` property.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_GLTFCamera_property_depth_near:
  65. .. rst-class:: classref-property
  66. :ref:`float<class_float>` **depth_near** = ``0.05``
  67. .. rst-class:: classref-property-setget
  68. - void **set_depth_near** **(** :ref:`float<class_float>` value **)**
  69. - :ref:`float<class_float>` **get_depth_near** **(** **)**
  70. The distance to the near culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF's ``znear`` property.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_GLTFCamera_property_fov:
  74. .. rst-class:: classref-property
  75. :ref:`float<class_float>` **fov** = ``1.309``
  76. .. rst-class:: classref-property-setget
  77. - void **set_fov** **(** :ref:`float<class_float>` value **)**
  78. - :ref:`float<class_float>` **get_fov** **(** **)**
  79. The FOV of the camera. This class and GLTF define the camera FOV in radians, while Godot uses degrees. This maps to GLTF's ``yfov`` property. This value is only used for perspective cameras, when :ref:`perspective<class_GLTFCamera_property_perspective>` is true.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_GLTFCamera_property_perspective:
  83. .. rst-class:: classref-property
  84. :ref:`bool<class_bool>` **perspective** = ``true``
  85. .. rst-class:: classref-property-setget
  86. - void **set_perspective** **(** :ref:`bool<class_bool>` value **)**
  87. - :ref:`bool<class_bool>` **get_perspective** **(** **)**
  88. Whether or not the camera is in perspective mode. If false, the camera is in orthographic/orthogonal mode. This maps to GLTF's camera ``type`` property. See :ref:`Camera3D.projection<class_Camera3D_property_projection>` and the GLTF spec for more information.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_GLTFCamera_property_size_mag:
  92. .. rst-class:: classref-property
  93. :ref:`float<class_float>` **size_mag** = ``0.5``
  94. .. rst-class:: classref-property-setget
  95. - void **set_size_mag** **(** :ref:`float<class_float>` value **)**
  96. - :ref:`float<class_float>` **get_size_mag** **(** **)**
  97. The size of the camera. This class and GLTF define the camera size magnitude as a radius in meters, while Godot defines it as a diameter in meters. This maps to GLTF's ``ymag`` property. This value is only used for orthographic/orthogonal cameras, when :ref:`perspective<class_GLTFCamera_property_perspective>` is false.
  98. .. rst-class:: classref-section-separator
  99. ----
  100. .. rst-class:: classref-descriptions-group
  101. Method Descriptions
  102. -------------------
  103. .. _class_GLTFCamera_method_from_dictionary:
  104. .. rst-class:: classref-method
  105. :ref:`GLTFCamera<class_GLTFCamera>` **from_dictionary** **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |static|
  106. Creates a new GLTFCamera instance by parsing the given :ref:`Dictionary<class_Dictionary>`.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_GLTFCamera_method_from_node:
  110. .. rst-class:: classref-method
  111. :ref:`GLTFCamera<class_GLTFCamera>` **from_node** **(** :ref:`Camera3D<class_Camera3D>` camera_node **)** |static|
  112. Create a new GLTFCamera instance from the given Godot :ref:`Camera3D<class_Camera3D>` node.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_GLTFCamera_method_to_dictionary:
  116. .. rst-class:: classref-method
  117. :ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
  118. Serializes this GLTFCamera instance into a :ref:`Dictionary<class_Dictionary>`.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_GLTFCamera_method_to_node:
  122. .. rst-class:: classref-method
  123. :ref:`Camera3D<class_Camera3D>` **to_node** **(** **)** |const|
  124. Converts this GLTFCamera instance into a Godot :ref:`Camera3D<class_Camera3D>` node.
  125. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  126. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  127. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  128. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  129. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  130. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`