class_gltfcamera.rst 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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/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. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  19. - `glTF camera detailed specification <https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-camera>`__
  20. - `glTF camera spec and example file <https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_015_SimpleCameras.md>`__
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------+-----------------------------------------------------------+------------+
  27. | :ref:`float<class_float>` | :ref:`depth_far<class_GLTFCamera_property_depth_far>` | ``4000.0`` |
  28. +---------------------------+-----------------------------------------------------------+------------+
  29. | :ref:`float<class_float>` | :ref:`depth_near<class_GLTFCamera_property_depth_near>` | ``0.05`` |
  30. +---------------------------+-----------------------------------------------------------+------------+
  31. | :ref:`float<class_float>` | :ref:`fov<class_GLTFCamera_property_fov>` | ``1.309`` |
  32. +---------------------------+-----------------------------------------------------------+------------+
  33. | :ref:`bool<class_bool>` | :ref:`perspective<class_GLTFCamera_property_perspective>` | ``true`` |
  34. +---------------------------+-----------------------------------------------------------+------------+
  35. | :ref:`float<class_float>` | :ref:`size_mag<class_GLTFCamera_property_size_mag>` | ``0.5`` |
  36. +---------------------------+-----------------------------------------------------------+------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`GLTFCamera<class_GLTFCamera>` | :ref:`from_dictionary<class_GLTFCamera_method_from_dictionary>`\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| |
  44. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`GLTFCamera<class_GLTFCamera>` | :ref:`from_node<class_GLTFCamera_method_from_node>`\ (\ camera_node\: :ref:`Camera3D<class_Camera3D>`\ ) |static| |
  46. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFCamera_method_to_dictionary>`\ (\ ) |const| |
  48. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Camera3D<class_Camera3D>` | :ref:`to_node<class_GLTFCamera_method_to_node>`\ (\ ) |const| |
  50. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_GLTFCamera_property_depth_far:
  57. .. rst-class:: classref-property
  58. :ref:`float<class_float>` **depth_far** = ``4000.0`` :ref:`🔗<class_GLTFCamera_property_depth_far>`
  59. .. rst-class:: classref-property-setget
  60. - |void| **set_depth_far**\ (\ value\: :ref:`float<class_float>`\ )
  61. - :ref:`float<class_float>` **get_depth_far**\ (\ )
  62. 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.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_GLTFCamera_property_depth_near:
  66. .. rst-class:: classref-property
  67. :ref:`float<class_float>` **depth_near** = ``0.05`` :ref:`🔗<class_GLTFCamera_property_depth_near>`
  68. .. rst-class:: classref-property-setget
  69. - |void| **set_depth_near**\ (\ value\: :ref:`float<class_float>`\ )
  70. - :ref:`float<class_float>` **get_depth_near**\ (\ )
  71. 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.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_GLTFCamera_property_fov:
  75. .. rst-class:: classref-property
  76. :ref:`float<class_float>` **fov** = ``1.309`` :ref:`🔗<class_GLTFCamera_property_fov>`
  77. .. rst-class:: classref-property-setget
  78. - |void| **set_fov**\ (\ value\: :ref:`float<class_float>`\ )
  79. - :ref:`float<class_float>` **get_fov**\ (\ )
  80. 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``.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_GLTFCamera_property_perspective:
  84. .. rst-class:: classref-property
  85. :ref:`bool<class_bool>` **perspective** = ``true`` :ref:`🔗<class_GLTFCamera_property_perspective>`
  86. .. rst-class:: classref-property-setget
  87. - |void| **set_perspective**\ (\ value\: :ref:`bool<class_bool>`\ )
  88. - :ref:`bool<class_bool>` **get_perspective**\ (\ )
  89. If ``true``, the camera is in perspective mode. Otherwise, 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.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_GLTFCamera_property_size_mag:
  93. .. rst-class:: classref-property
  94. :ref:`float<class_float>` **size_mag** = ``0.5`` :ref:`🔗<class_GLTFCamera_property_size_mag>`
  95. .. rst-class:: classref-property-setget
  96. - |void| **set_size_mag**\ (\ value\: :ref:`float<class_float>`\ )
  97. - :ref:`float<class_float>` **get_size_mag**\ (\ )
  98. 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``.
  99. .. rst-class:: classref-section-separator
  100. ----
  101. .. rst-class:: classref-descriptions-group
  102. Method Descriptions
  103. -------------------
  104. .. _class_GLTFCamera_method_from_dictionary:
  105. .. rst-class:: classref-method
  106. :ref:`GLTFCamera<class_GLTFCamera>` **from_dictionary**\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| :ref:`🔗<class_GLTFCamera_method_from_dictionary>`
  107. Creates a new GLTFCamera instance by parsing the given :ref:`Dictionary<class_Dictionary>`.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_GLTFCamera_method_from_node:
  111. .. rst-class:: classref-method
  112. :ref:`GLTFCamera<class_GLTFCamera>` **from_node**\ (\ camera_node\: :ref:`Camera3D<class_Camera3D>`\ ) |static| :ref:`🔗<class_GLTFCamera_method_from_node>`
  113. Create a new GLTFCamera instance from the given Godot :ref:`Camera3D<class_Camera3D>` node.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_GLTFCamera_method_to_dictionary:
  117. .. rst-class:: classref-method
  118. :ref:`Dictionary<class_Dictionary>` **to_dictionary**\ (\ ) |const| :ref:`🔗<class_GLTFCamera_method_to_dictionary>`
  119. Serializes this GLTFCamera instance into a :ref:`Dictionary<class_Dictionary>`.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_GLTFCamera_method_to_node:
  123. .. rst-class:: classref-method
  124. :ref:`Camera3D<class_Camera3D>` **to_node**\ (\ ) |const| :ref:`🔗<class_GLTFCamera_method_to_node>`
  125. Converts this GLTFCamera instance into a Godot :ref:`Camera3D<class_Camera3D>` node.
  126. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  127. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  128. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  129. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  130. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  131. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  132. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  133. .. |void| replace:: :abbr:`void (No return value.)`