Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

GLTFCamera

繼承: Resource < RefCounted < Object

Represents a glTF camera.

說明

Represents a camera as defined by the base glTF spec.

教學

屬性

float

depth_far

4000.0

float

depth_near

0.05

float

fov

1.3089969

bool

perspective

true

float

size_mag

0.5

方法

GLTFCamera

from_dictionary(dictionary: Dictionary) static

GLTFCamera

from_node(camera_node: Camera3D) static

Dictionary

to_dictionary() const

Camera3D

to_node() const


屬性說明

float depth_far = 4000.0 🔗

  • void set_depth_far(value: float)

  • 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.


float depth_near = 0.05 🔗

  • void set_depth_near(value: float)

  • 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.


float fov = 1.3089969 🔗

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(value: bool)

  • bool get_perspective()

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.


float size_mag = 0.5 🔗

  • void set_size_mag(value: float)

  • 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.


方法說明

GLTFCamera from_dictionary(dictionary: Dictionary) static 🔗

通過解析給定的 Dictionary 新建 GLTFCamera 實例。


GLTFCamera from_node(camera_node: Camera3D) static 🔗

從給定的 Godot Camera3D 節點新建 GLTFCamera 實例。


Dictionary to_dictionary() const 🔗

將這個 GLTFCamera 實例序列化為 Dictionary


Camera3D to_node() const 🔗

將這個 GLTFCamera 實例轉換為 Godot Camera3D 節點。