class_gltfcamera.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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/GLTFCamera.xml.
  6. .. _class_GLTFCamera:
  7. GLTFCamera
  8. ==========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :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. \ **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to **GLTFCamera** within a script will cause an error in an exported project.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  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:`fov_size<class_GLTFCamera_property_fov_size>` | ``1.309`` |
  28. +---------------------------+-----------------------------------------------------------+------------+
  29. | :ref:`bool<class_bool>` | :ref:`perspective<class_GLTFCamera_property_perspective>` | ``true`` |
  30. +---------------------------+-----------------------------------------------------------+------------+
  31. | :ref:`float<class_float>` | :ref:`size_mag<class_GLTFCamera_property_size_mag>` | ``0.5`` |
  32. +---------------------------+-----------------------------------------------------------+------------+
  33. | :ref:`float<class_float>` | :ref:`zfar<class_GLTFCamera_property_zfar>` | ``4000.0`` |
  34. +---------------------------+-----------------------------------------------------------+------------+
  35. | :ref:`float<class_float>` | :ref:`znear<class_GLTFCamera_property_znear>` | ``0.05`` |
  36. +---------------------------+-----------------------------------------------------------+------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-------------------------------------+---------------------------------------------------------------------------------+
  43. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFCamera_method_to_dictionary>` **(** **)** |const| |
  44. +-------------------------------------+---------------------------------------------------------------------------------+
  45. | :ref:`Camera<class_Camera>` | :ref:`to_node<class_GLTFCamera_method_to_node>` **(** **)** |const| |
  46. +-------------------------------------+---------------------------------------------------------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Property Descriptions
  51. ---------------------
  52. .. _class_GLTFCamera_property_fov_size:
  53. .. rst-class:: classref-property
  54. :ref:`float<class_float>` **fov_size** = ``1.309``
  55. .. rst-class:: classref-property-setget
  56. - void **set_fov_size** **(** :ref:`float<class_float>` value **)**
  57. - :ref:`float<class_float>` **get_fov_size** **(** **)**
  58. 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.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_GLTFCamera_property_perspective:
  62. .. rst-class:: classref-property
  63. :ref:`bool<class_bool>` **perspective** = ``true``
  64. .. rst-class:: classref-property-setget
  65. - void **set_perspective** **(** :ref:`bool<class_bool>` value **)**
  66. - :ref:`bool<class_bool>` **get_perspective** **(** **)**
  67. 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:`Camera.projection<class_Camera_property_projection>` and the GLTF spec for more information.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_GLTFCamera_property_size_mag:
  71. .. rst-class:: classref-property
  72. :ref:`float<class_float>` **size_mag** = ``0.5``
  73. .. rst-class:: classref-property-setget
  74. - void **set_size_mag** **(** :ref:`float<class_float>` value **)**
  75. - :ref:`float<class_float>` **get_size_mag** **(** **)**
  76. 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.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_GLTFCamera_property_zfar:
  80. .. rst-class:: classref-property
  81. :ref:`float<class_float>` **zfar** = ``4000.0``
  82. .. rst-class:: classref-property-setget
  83. - void **set_zfar** **(** :ref:`float<class_float>` value **)**
  84. - :ref:`float<class_float>` **get_zfar** **(** **)**
  85. 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.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_GLTFCamera_property_znear:
  89. .. rst-class:: classref-property
  90. :ref:`float<class_float>` **znear** = ``0.05``
  91. .. rst-class:: classref-property-setget
  92. - void **set_znear** **(** :ref:`float<class_float>` value **)**
  93. - :ref:`float<class_float>` **get_znear** **(** **)**
  94. 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.
  95. .. rst-class:: classref-section-separator
  96. ----
  97. .. rst-class:: classref-descriptions-group
  98. Method Descriptions
  99. -------------------
  100. .. _class_GLTFCamera_method_to_dictionary:
  101. .. rst-class:: classref-method
  102. :ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
  103. Serializes this GLTFCamera instance into a :ref:`Dictionary<class_Dictionary>`.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_GLTFCamera_method_to_node:
  107. .. rst-class:: classref-method
  108. :ref:`Camera<class_Camera>` **to_node** **(** **)** |const|
  109. Converts this GLTFCamera instance into a Godot :ref:`Camera<class_Camera>` node.
  110. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  111. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  112. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  113. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`