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...
NavigationLink3D
實驗性: This class may be changed or removed in future versions.
連接兩個位於 NavigationRegion3D 上的位置的連結,導覽時能夠讓代理走這個鏈接。
說明
連接兩個位於 NavigationRegion3D 上的位置的連結,導覽時能夠讓代理走這個鏈接。這兩個位置可以在同一個 NavigationRegion3D 上,也可以是在兩個不同的區塊上。連結可以用來表達沿著導覽網格表面行進以外的導覽方法,例如滑鎖、傳送、跳過溝壑等等。
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
get_global_end_position() const |
|
get_global_start_position() const |
|
get_navigation_layer_value(layer_number: int) const |
|
get_navigation_map() const |
|
get_rid() const |
|
void |
set_global_end_position(position: Vector3) |
void |
set_global_start_position(position: Vector3) |
void |
set_navigation_layer_value(layer_number: int, value: bool) |
void |
set_navigation_map(navigation_map: RID) |
屬性說明
返回這個連接是可以雙向通行,還是只能從 start_position 通向 end_position。
該連結目前是否處於活動狀態。如果為 false ,則 NavigationServer3D.map_get_path() 會忽略這個連結。
Vector3 end_position = Vector3(0, 0, 0) 🔗
連結的結束位置。
連結會搜索導覽網格中最接近這個位置的多邊形,並將自身與該多邊形相關聯。
連結搜索的距離由 NavigationServer3D.map_set_link_connection_radius() 控制。
當尋路從其他地區的導覽網格進入該連結時,enter_cost 會加到路徑距離中,用於確定最短路徑。
決定連結所屬導覽層的位元域。使用 NavigationServer3D.map_get_path() 請求路徑時會檢查這些導覽層。
Vector3 start_position = Vector3(0, 0, 0) 🔗
連結的起始位置。
連結會搜索導覽網格中最接近這個位置的多邊形,並將自身與該多邊形相關聯。
連結搜索的距離由 NavigationServer3D.map_set_link_connection_radius() 控制。
當尋路沿著該連結移動時,移動距離會和 travel_cost 相乘,用於確定最短路徑。
方法說明
Vector3 get_global_end_position() const 🔗
返回該連結的 end_position 的全域位置。
Vector3 get_global_start_position() const 🔗
返回該連結的 start_position 的全域位置。
bool get_navigation_layer_value(layer_number: int) const 🔗
返回 navigation_layers 位元遮罩中指定的層是否啟用,給定的 layer_number 應在 1 和 32 之間。
RID get_navigation_map() const 🔗
Returns the current navigation map RID used by this link.
Returns the RID of this link on the NavigationServer3D.
void set_global_end_position(position: Vector3) 🔗
設定該連結的 end_position 的全域位置。
void set_global_start_position(position: Vector3) 🔗
設定該連結的 start_position 的全域位置。
void set_navigation_layer_value(layer_number: int, value: bool) 🔗
根據 value,啟用或禁用 navigation_layers 位元遮罩中指定的層,給定的 layer_number 應在 1 和 32 之間。
void set_navigation_map(navigation_map: RID) 🔗
Sets the RID of the navigation map this link should use. By default the link will automatically join the World3D default navigation map so this function is only required to override the default map.