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.
Checking the stable version of the documentation...
PathFollow3D
Path3D 的點取樣器。
說明
這個節點接受它的父節點 Path3D 並返回其中一個點的座標,需要給定到第一個頂點的距離。
在不編碼移動圖案的情況下,它可以使其他節點遵循一條路徑。為此,節點必須是該節點的子節點。在該節點中設定 progress 後,後代節點會隨之移動。
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
correct_posture(transform: Transform3D, rotation_mode: RotationMode) static |
列舉
enum RotationMode: 🔗
RotationMode ROTATION_NONE = 0
禁止該 PathFollow3D 旋轉。
RotationMode ROTATION_Y = 1
允許該 PathFollow3D 僅在 Y 軸上旋轉。
RotationMode ROTATION_XY = 2
允許該 PathFollow3D 同時在 X 和 Y 軸上旋轉。
RotationMode ROTATION_XYZ = 3
允許該 PathFollow3D 在任意軸上旋轉。
RotationMode ROTATION_ORIENTED = 4
使用 Curve3D 中的向上向量資訊來強制定向。該旋轉模式需要將 Path3D 的 Curve3D.up_vector_enabled 屬性設定為 true。
屬性說明
如果為 true,則兩個快取點之間的位置將被三次插值,否則將被線性插值。
沿著 Path3D 的 Curve3D 的點在使用前已被預先計算,以便更快地計算。然後在兩個相鄰快取點之間,插值計算請求的偏移處的點。如果曲線急轉彎,這可能會出現問題,因為快取的點可能沒有足夠緊密地跟隨曲線。
這個問題有兩個答案:要麼增加快取點的數量,並增加記憶體消耗;要麼在兩個點之間進行三次插值,代價是(稍微)降低計算速度。
節點沿曲線的偏移量。
如果為 true,路徑長度以外的任何偏移都將環繞,而不是在結束時停止。對於迴圈路徑使用它。
到第一個頂點的距離,單位為沿路徑經過的 3D 單位數。改變這個值會將這個節點的位置設定為路徑上的某個點。
The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length.
It can be set or get only if the PathFollow3D is the child of a Path3D which is part of the scene tree, and that this Path3D has a Curve3D with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return 0.0.
RotationMode rotation_mode = 3 🔗
void set_rotation_mode(value: RotationMode)
RotationMode get_rotation_mode()
允許或禁止在一個或多個軸上旋轉,這取決於使用的 RotationMode 常數。
如果為 true,則 Curve3D 的傾斜屬性生效。
bool use_model_front = false 🔗
如果為 true,則沿路徑移動的節點會將 +Z 軸作為前方向進行朝向。另見 Vector3.FORWARD 和 Vector3.MODEL_FRONT。
節點垂直於曲線的偏移量。
方法說明
Transform3D correct_posture(transform: Transform3D, rotation_mode: RotationMode) static 🔗
校正 transform。rotation_mode 隱式指定如何計算姿勢(向前、向上和側向)。