:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.0/modules/gltf/doc_classes/GLTFCamera.xml. .. _class_GLTFCamera: GLTFCamera ========== **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Represents a GLTF camera. .. rst-class:: classref-introduction-group Description ----------- Represents a camera as defined by the base GLTF spec. .. rst-class:: classref-introduction-group Tutorials --------- - `GLTF camera detailed specification `__ - `GLTF camera spec and example file `__ .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +---------------------------+-----------------------------------------------------------+------------+ | :ref:`float` | :ref:`depth_far` | ``4000.0`` | +---------------------------+-----------------------------------------------------------+------------+ | :ref:`float` | :ref:`depth_near` | ``0.05`` | +---------------------------+-----------------------------------------------------------+------------+ | :ref:`float` | :ref:`fov` | ``1.309`` | +---------------------------+-----------------------------------------------------------+------------+ | :ref:`bool` | :ref:`perspective` | ``true`` | +---------------------------+-----------------------------------------------------------+------------+ | :ref:`float` | :ref:`size_mag` | ``0.5`` | +---------------------------+-----------------------------------------------------------+------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`GLTFCamera` | :ref:`from_dictionary` **(** :ref:`Dictionary` dictionary **)** |static| | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`GLTFCamera` | :ref:`from_node` **(** :ref:`Camera3D` camera_node **)** |static| | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`to_dictionary` **(** **)** |const| | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Camera3D` | :ref:`to_node` **(** **)** |const| | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GLTFCamera_property_depth_far: .. rst-class:: classref-property :ref:`float` **depth_far** = ``4000.0`` .. rst-class:: classref-property-setget - void **set_depth_far** **(** :ref:`float` value **)** - :ref:`float` **get_depth_far** **(** **)** 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. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_property_depth_near: .. rst-class:: classref-property :ref:`float` **depth_near** = ``0.05`` .. rst-class:: classref-property-setget - void **set_depth_near** **(** :ref:`float` value **)** - :ref:`float` **get_depth_near** **(** **)** 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. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_property_fov: .. rst-class:: classref-property :ref:`float` **fov** = ``1.309`` .. rst-class:: classref-property-setget - void **set_fov** **(** :ref:`float` value **)** - :ref:`float` **get_fov** **(** **)** 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` is true. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_property_perspective: .. rst-class:: classref-property :ref:`bool` **perspective** = ``true`` .. rst-class:: classref-property-setget - void **set_perspective** **(** :ref:`bool` value **)** - :ref:`bool` **get_perspective** **(** **)** 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` and the GLTF spec for more information. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_property_size_mag: .. rst-class:: classref-property :ref:`float` **size_mag** = ``0.5`` .. rst-class:: classref-property-setget - void **set_size_mag** **(** :ref:`float` value **)** - :ref:`float` **get_size_mag** **(** **)** 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` is false. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GLTFCamera_method_from_dictionary: .. rst-class:: classref-method :ref:`GLTFCamera` **from_dictionary** **(** :ref:`Dictionary` dictionary **)** |static| Creates a new GLTFCamera instance by parsing the given :ref:`Dictionary`. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_method_from_node: .. rst-class:: classref-method :ref:`GLTFCamera` **from_node** **(** :ref:`Camera3D` camera_node **)** |static| Create a new GLTFCamera instance from the given Godot :ref:`Camera3D` node. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_method_to_dictionary: .. rst-class:: classref-method :ref:`Dictionary` **to_dictionary** **(** **)** |const| Serializes this GLTFCamera instance into a :ref:`Dictionary`. .. rst-class:: classref-item-separator ---- .. _class_GLTFCamera_method_to_node: .. rst-class:: classref-method :ref:`Camera3D` **to_node** **(** **)** |const| Converts this GLTFCamera instance into a Godot :ref:`Camera3D` node. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`