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...
SpringArm3D
能夠動態地將子節點朝碰撞點移動的 3D 射線投射。
說明
SpringArm3D 會朝它的 Z 軸投射射線或形狀,並將所有直接子節點朝碰撞點移動,可以保留一定的邊距。可用於第三人稱相機,讓其在狹窄空間中朝玩家移動(你可能需要在 SpringArm3D 的碰撞檢查中排除玩家的碰撞體)。
教學
屬性
|
||
|
||
|
方法
void |
add_excluded_object(RID: RID) |
void |
|
remove_excluded_object(RID: RID) |
屬性說明
The layers against which the collision check will be done. See Collision layers and masks in the documentation for more information.
進行碰撞偵測時,會給出 SpringArm3D 的一個候選長度。
然後將邊距減去該長度,並將該平移套用於該 SpringArm3D 的子物件。
當 SpringArm3D 有一個 Camera3D 作為子節點時,該邊距很有用:如果沒有邊距,該 Camera3D 將被放置在準確的碰撞點上;而有邊距時,該 Camera3D 將被放置在靠近碰撞點的地方。
用於該 SpringArm3D 的 Shape3D。
當該形狀被設定後,SpringArm3D 將在其 z 軸上投射該 Shape3D,而不是執行一個射線投射。
SpringArm3D 的最大範圍。這用作內部使用的射線和形狀投射的長度,以計算 SpringArm3D 子節點的所需位置。
要瞭解有關如何執行形狀投射或射線投射的更多資訊,請參閱 PhysicsDirectSpaceState3D 文件。
方法說明
void add_excluded_object(RID: RID) 🔗
將具有給定 RID 的 PhysicsBody3D 物件,新增到從碰撞檢查中排除的 PhysicsBody3D 對象列表中。
void clear_excluded_objects() 🔗
清空碰撞偵測排除 PhysicsBody3D 對象的列表。
返回彈簧臂的目前長度。
bool remove_excluded_object(RID: RID) 🔗
從碰撞偵測排除 PhysicsBody3D 對象的列表中移除給定的 RID。