NavigationLink3D

实验性: This class may be changed or removed in future versions.

继承: Node3D < Node < Object

A link between two positions on NavigationRegion3D s that agents can be routed through.

描述

A link between two positions on NavigationRegion3D s that agents can be routed through. These positions can be on the same NavigationRegion3D or on two different ones. Links are useful to express navigation methods other than traveling along the surface of the navigation mesh, such as ziplines, teleporters, or gaps that can be jumped across.

属性

方法

Vector3get_global_end_position ( ) const1
Vector3get_global_start_position ( ) const1
boolget_navigation_layer_value ( layer_number: int ) const1
RIDget_navigation_map ( ) const1
RIDget_rid ( ) const1
voidset_global_end_position ( position: Vector3 )
voidset_global_start_position ( position: Vector3 )
voidset_navigation_layer_value ( layer_number: int, value: bool )
voidset_navigation_map ( navigation_map: RID )

属性说明

bool bidirectional = true

  • void set_bidirectional ( value: bool )
  • bool is_bidirectional ( )

Whether this link can be traveled in both directions or only from start_position to end_position.


bool enabled = true

  • void set_enabled ( value: bool )
  • bool is_enabled ( )

Whether this link is currently active. If false, NavigationServer3D.map_get_path will ignore this link.


Vector3 end_position = Vector3(0, 0, 0)

  • void set_end_position ( value: Vector3 )
  • Vector3 get_end_position ( )

Ending position of the link.

This position will search out the nearest polygon in the navigation mesh to attach to.

The distance the link will search is controlled by NavigationServer3D.map_set_link_connection_radius.


float enter_cost = 0.0

  • void set_enter_cost ( value: float )
  • float get_enter_cost ( )

When pathfinding enters this link from another regions navigation mesh the enter_cost value is added to the path distance for determining the shortest path.


int navigation_layers = 1

  • void set_navigation_layers ( value: int )
  • int get_navigation_layers ( )

A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with NavigationServer3D.map_get_path.


Vector3 start_position = Vector3(0, 0, 0)

  • void set_start_position ( value: Vector3 )
  • Vector3 get_start_position ( )

Starting position of the link.

This position will search out the nearest polygon in the navigation mesh to attach to.

The distance the link will search is controlled by NavigationServer3D.map_set_link_connection_radius.


float travel_cost = 1.0

  • void set_travel_cost ( value: float )
  • float get_travel_cost ( )

When pathfinding moves along the link the traveled distance is multiplied with travel_cost for determining the shortest path.


方法说明

Vector3 get_global_end_position ( ) const1

Returns the end_position that is relative to the link as a global position.


Vector3 get_global_start_position ( ) const1

Returns the start_position that is relative to the link as a global position.


bool get_navigation_layer_value ( layer_number: int ) const1

Returns whether or not the specified layer of the navigation_layers bitmask is enabled, given a layer_number between 1 and 32.


RID get_navigation_map ( ) const1

Returns the current navigation map RID used by this link.


RID get_rid ( ) const1

Returns the RID of this link on the NavigationServer3D.


void set_global_end_position ( position: Vector3 )

Sets the end_position that is relative to the link from a global position.


void set_global_start_position ( position: Vector3 )

Sets the start_position that is relative to the link from a global position.


void set_navigation_layer_value ( layer_number: int, value: bool )

Based on value, enables or disables the specified layer in the navigation_layers bitmask, given a layer_number between 1 and 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.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。