GFCameraOrbitRig3D¶
API Reference / Camera / 类索引
- 路径:
addons/gf/extensions/camera/nodes/gf_camera_orbit_rig_3d.gd - 模块:
Camera - 继承:
GFCameraRig3D - API:
public - 类别:运行时句柄 (
runtime_handle) - 首次版本:
3.23.0
通用 3D 环绕相机 Rig。 基于目标焦点、yaw / pitch 和距离计算期望 Camera3D Transform。 它只描述相机姿态,不处理碰撞、锁定目标、遮挡或具体玩法输入。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 信号 | orbit_changed |
signal orbit_changed(yaw_degrees_value: float, pitch_degrees_value: float, distance_value: float) |
| 属性 | yaw_degrees |
var yaw_degrees: float = 0.0: |
| 属性 | pitch_degrees |
var pitch_degrees: float = -20.0: |
| 属性 | distance |
var distance: float = 8.0: |
| 属性 | min_distance |
var min_distance: float = 1.0: |
| 属性 | max_distance |
var max_distance: float = 50.0: |
| 属性 | min_pitch_degrees |
var min_pitch_degrees: float = -80.0: |
| 属性 | max_pitch_degrees |
var max_pitch_degrees: float = 80.0: |
| 属性 | look_at_focus |
var look_at_focus: bool = true |
| 属性 | orbit_up_axis |
var orbit_up_axis: Vector3 = Vector3.UP |
| 方法 | get_focus_position |
func get_focus_position() -> Vector3: |
| 方法 | get_orbit_direction |
func get_orbit_direction() -> Vector3: |
| 方法 | get_camera_transform |
func get_camera_transform() -> Transform3D: |
| 方法 | set_orbit |
func set_orbit(new_yaw_degrees: float, new_pitch_degrees: float, new_distance: float) -> void: |
| 方法 | apply_orbit_delta |
func apply_orbit_delta(delta_degrees: Vector2) -> void: |
| 方法 | apply_zoom_delta |
func apply_zoom_delta(delta_distance: float) -> void: |
| 方法 | clamp_orbit |
func clamp_orbit() -> void: |
| 方法 | get_debug_snapshot |
func get_debug_snapshot() -> Dictionary: |
信号¶
orbit_changed¶
- API:
public
环绕参数变化后发出。
参数:
| 名称 | 说明 |
|---|---|
yaw_degrees_value |
当前水平角度。 |
pitch_degrees_value |
当前俯仰角度。 |
distance_value |
当前距离。 |
属性¶
yaw_degrees¶
- API:
public
水平角度,单位度。
pitch_degrees¶
- API:
public
俯仰角度,单位度。
distance¶
- API:
public
与焦点的距离。
min_distance¶
- API:
public
最小距离。
max_distance¶
- API:
public
最大距离。
min_pitch_degrees¶
- API:
public
最小俯仰角度。
max_pitch_degrees¶
- API:
public
最大俯仰角度。
look_at_focus¶
- API:
public
是否让相机始终朝向焦点。
orbit_up_axis¶
- API:
public
环绕相机的上方向。为零向量时回退到 Vector3.UP。
方法¶
get_focus_position¶
- API:
public
获取环绕焦点位置。
返回:当前焦点的全局位置。
get_orbit_direction¶
- API:
public
获取从焦点指向相机的单位方向。
返回:环绕方向。
get_camera_transform¶
- API:
public
获取当前期望相机 Transform。
返回:期望全局 Transform。
set_orbit¶
- API:
public
设置环绕参数。
参数:
| 名称 | 说明 |
|---|---|
new_yaw_degrees |
水平角度,单位度。 |
new_pitch_degrees |
俯仰角度,单位度。 |
new_distance |
与焦点的距离。 |
apply_orbit_delta¶
- API:
public
应用环绕角度增量。
参数:
| 名称 | 说明 |
|---|---|
delta_degrees |
x 为 yaw 增量,y 为 pitch 增量,单位度。 |
apply_zoom_delta¶
- API:
public
应用距离增量。
参数:
| 名称 | 说明 |
|---|---|
delta_distance |
距离增量;正数拉远,负数拉近。 |
clamp_orbit¶
- API:
public
按当前上下限夹紧环绕参数。
get_debug_snapshot¶
- API:
public
获取环绕 Rig 调试快照。
返回:调试快照。
结构:
return: Dictionary,包含 yaw_degrees、pitch_degrees、distance、focus_position 和 direction。