github_url: | hide |
---|
Inherits: :ref:`Node<class_Node>` < :ref:`Object<class_Object>`
3D Agent used in navigation for collision avoidance.
3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. This can be done by having the agent as a child of a :ref:`Navigation<class_Navigation>` node, or using :ref:`set_navigation<class_NavigationAgent_method_set_navigation>`. NavigationAgent
is physics safe.
Notifies when the final location is reached.
Notifies when the navigation path changes.
Notifies when the player defined target, set with :ref:`set_target_location<class_NavigationAgent_method_set_target_location>`, is reached.
Notifies when the collision avoidance velocity is calculated. Emitted by :ref:`set_velocity<class_NavigationAgent_method_set_velocity>`.
Default | 0.0 |
Setter | set_agent_height_offset(value) |
Getter | get_agent_height_offset() |
The agent height offset to match the navigation mesh height.
Default | true |
Setter | set_ignore_y(value) |
Getter | get_ignore_y() |
Ignores collisions on the Y axis. Must be true to move on a horizontal plane.
Default | 10 |
Setter | set_max_neighbors(value) |
Getter | get_max_neighbors() |
The maximum number of neighbors for the agent to consider.
Default | 10.0 |
Setter | set_max_speed(value) |
Getter | get_max_speed() |
The maximum speed that an agent can move.
Default | 50.0 |
Setter | set_neighbor_dist(value) |
Getter | get_neighbor_dist() |
The distance to search for other agents.
Default | 3.0 |
Setter | set_path_max_distance(value) |
Getter | get_path_max_distance() |
The maximum distance the agent is allowed away from the ideal path to the final location. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
Default | 1.0 |
Setter | set_radius(value) |
Getter | get_radius() |
The radius of the agent.
Default | 1.0 |
Setter | set_target_desired_distance(value) |
Getter | get_target_desired_distance() |
The distance threshold before a target is considered to be reached. This will allow an agent to not have to hit a point on the path exactly, but in the area.
Default | 5.0 |
Setter | set_time_horizon(value) |
Getter | get_time_horizon() |
The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithim, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. Must be positive.
Returns the distance to the target location, using the agent's global position. The user must set the target location with :ref:`set_target_location<class_NavigationAgent_method_set_target_location>` in order for this to be accurate.
Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame.
Returns the path from start to finish in global coordinates.
Returns which index the agent is currently on in the navigation path's :ref:`PackedVector3Array<class_PackedVector3Array>`.
Returns the :ref:`Navigation<class_Navigation>` node that the agent is using for its navigation system.
Returns a :ref:`Vector3<class_Vector3>` in global coordinates, that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the origin of the agent's parent.
Returns the user defined :ref:`Vector3<class_Vector3>` after setting the target location.
Returns true if the navigation path's final location has been reached.
Returns true if the target location is reachable. The target location is set using :ref:`set_target_location<class_NavigationAgent_method_set_target_location>`.
Returns true if the target location is reached. The target location is set using :ref:`set_target_location<class_NavigationAgent_method_set_target_location>`. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See :ref:`get_final_location<class_NavigationAgent_method_get_final_location>`.
Sets the :ref:`Navigation<class_Navigation>` node used by the agent. Useful when you don't want to make the agent a child of a :ref:`Navigation<class_Navigation>` node.
Sets the user desired final location. This will clear the current navigation path.
Sends the passed in velocity to the collision avoidance algorithm. It will adjust the velocity to avoid collisions. Once the adjustment to the velocity is complete, it will emit the :ref:`velocity_computed<class_NavigationAgent_signal_velocity_computed>` signal.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。