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

代表 glTF 相機。

說明

代表基礎 glTF 規格中定義的相機。

教學

屬性

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()

該相機與遠剔除邊界的距離,相對於其區域 Z 軸,單位為米。映射到 glTF 的 zfar 屬性。


float depth_near = 0.05 🔗

  • void set_depth_near(value: float)

  • float get_depth_near()

該相機與近剔除邊界的距離,相對於其區域 Z 軸,單位為米。映射到 glTF 的 znear 屬性。


float fov = 1.3089969 🔗

該相機的 FOV。這個類和 glTF 在定義相機 FOV 時使用的都是弧度,但 Godot 使用的是度。映射到 glTF 的 yfov 屬性。只在透視相機中使用,即 perspective 為 true 時。


bool perspective = true 🔗

  • void set_perspective(value: bool)

  • bool get_perspective()

如果為 true,則相機處於透視模式。否則相機處於正交模式。映射到 glTF 的相機 type 屬性。詳見 Camera3D.projection 及 glTF 規格。


float size_mag = 0.5 🔗

  • void set_size_mag(value: float)

  • float get_size_mag()

該相機的大小。這個類和 glTF 在定義相機大小尺度時使用的都是半徑的米數,但 Godot 使用的是直徑的米數。映射到 glTF 的 ymag 屬性。只在正交相機中使用,即 perspective 為 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 節點。