GLTFCamera

Inherits: Resource < Reference < Object

Represents a GLTF camera.

Description

Represents a camera as defined by the base GLTF spec.

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.

Tutorials

Properties

float

fov_size

1.309

bool

perspective

true

float

size_mag

0.5

float

zfar

4000.0

float

znear

0.05

Methods

Dictionary

to_dictionary ( ) const

Camera

to_node ( ) const


Property Descriptions

float fov_size = 1.309

  • void set_fov_size ( float value )

  • float get_fov_size ( )

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 perspective is true.


bool perspective = true

  • void set_perspective ( bool value )

  • 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 Camera.projection and the GLTF spec for more information.


float size_mag = 0.5

  • void set_size_mag ( float value )

  • 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 perspective is false.


float zfar = 4000.0

  • void set_zfar ( float value )

  • float get_zfar ( )

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.


float znear = 0.05

  • void set_znear ( float value )

  • float get_znear ( )

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.


Method Descriptions

Dictionary to_dictionary ( ) const

Serializes this GLTFCamera instance into a Dictionary.


Camera to_node ( ) const

Converts this GLTFCamera instance into a Godot Camera node.