Skip to content

GLTFCamera

Inherits: Resource < RefCounted < Object

Represents a glTF camera.

Represents a camera as defined by the base glTF spec.

Type Name Default
float depth_far 4000.0
float depth_near 0.05
float fov 1.3089969
bool perspective true
float size_mag 0.5
Returns Method
GLTFCamera from_dictionary(dictionary: Dictionary) static
GLTFCamera from_node(camera_node: Camera3D) static
Dictionary to_dictionary() const
Camera3D to_node() const

depth_far

float depth_far = 4000.0

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.

depth_near

float depth_near = 0.05

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.

fov

float fov = 1.3089969

The FOV of the camera. This class and glTF define the camera FOV in radians, while Orblit uses degrees. This maps to glTF’s yfov property. This value is only used for perspective cameras, when perspective is true.

perspective

bool perspective = true

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 Camera3D.projection and the glTF spec for more information.

size_mag

float size_mag = 0.5

The size of the camera. This class and glTF define the camera size magnitude as a radius in meters, while Orblit 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.

from_dictionary

GLTFCamera from_dictionary(dictionary: Dictionary) static

Creates a new GLTFCamera instance by parsing the given Dictionary.

from_node

GLTFCamera from_node(camera_node: Camera3D) static

Create a new GLTFCamera instance from the given Orblit Camera3D node.

to_dictionary

Dictionary to_dictionary() const

Serializes this GLTFCamera instance into a Dictionary.

to_node

Camera3D to_node() const

Converts this GLTFCamera instance into a Orblit Camera3D node.