Represents a Navigation bot.
Constructors and accessors
Other related reference items
Related help topics
cancel_compute_path_async ( self )Cancel current path computation, i.e. if stingray.GwNavBot.compute_astar_query was called and stingray.GwNavBot.is_computing_path returns true.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
clear_followed_path ( self )Clear the followed path of the specified GwNavBot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
compute_astar_query_async ( self, destination ) : booleanThe specified GwNavBot will calculate a path to the specified position.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
destination : | The desired endpoint of the path. |
boolean |
Tells if a new path computation path was successfully added. |
compute_move_on_navmesh ( self, delta_time, velocity ) : stingray.Vector3Outputs a valid position for the given GwNavBot where it can be safely placed on the NavMesh.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
delta_time : | number | The delta time in seconds since the last frame. |
velocity : | Optional velocity to apply, if not provided bot's output velocity is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
The position on the NavMesh. |
In the event that no position can be found, the input position is returned.
compute_move_on_spline ( self, distance ) : stingray.Vector3?, stingray.Vector3?If the specified GwNavBot has a spline, moves from the current position by distance along the spline.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
distance : | number | The distance to move on the spline. |
If the move succeeded, returns the position on the spline. Otherwise returns nil. The ? notation indicates that this type is optional: there may be zero or one instances of it. | |
If the move succeeded, returns the tangent of the position on the spline. Otherwise returns nil. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
compute_path_async ( self, astar ) : booleanThe specified GwNavBot will calculate a path using this query.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
astar : | A GwNavAStar to run whose found path will be followed by the bot, hence it should be set to run on the same database than the bot (Already done if init_astar_query is used). |
boolean |
Tells if the query was successfully added for computation. |
create ( database_or_world, height, radius, max_speed, position ) : stingray.GwNavBotCreates a GwNavBot.
|
database_or_world : | Specifies the GwNavDatabase the Bot will use to compute new destination. If a GwNavWorld, the default GwNavDatabase will be used. The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses. | |
height : | number | The height of the bot. |
radius : | number | The radius of the bot. |
max_speed : | number | The maximum linear speed of the bot. |
position : | The position where the bot should be spawned. |
The new GwNavBot. |
current_or_next_smartobject_interval ( self, smart_object_interval, max_distance ) : booleanWrite the current or next GwNavSmartObjectInterval if there is one.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
smart_object_interval : | The interval to write into | |
max_distance : | number | The maximum distance in meters we want to look ahead. |
boolean |
true if we successfully retrieved the current or next GwNavSmartObjectInterval, false otherwise. |
database ( self ) : stingray.GwNavDatabaseRetrieves the GwNavDatabase used by this bot for pathfinding and pathfollowing.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The GwNavDatabase used by this bot. |
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
enable_crowd_dispersion ( self, repath_distance, no_repath_distance )Enable use of crowd dispersion logic, user has to call update_logic_for_crowd_dispersion.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
repath_distance : | number? | The distance in meters used by the bot to check if the path must be recomputed in case a crowd dispersion passage is over crowded, default to 5 The ? notation indicates that this type is optional: there may be zero or one instances of it. |
no_repath_distance : | number? | The distance in meters used by the bot to stick to the current path even though it was considered overcrowded and the bot was currently computing an alternative path, default to 1 The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
enter_manual_control ( self, smart_object_interval ) : booleanRequests to enter manual control for the specified GwNavSmartObjectInterval.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
smart_object_interval : | The smart object interval on which the bot will be on manual control |
boolean |
true if we successfully entered manual control, false otherwise. |
exit_manual_control ( self ) : booleanRequests to exit manual control for the specified GwNavSmartObjectInterval.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
boolean |
true if we successfully exited manual control, false otherwise. |
get_astar_query ( self ) : stingray.GwNavAStar |
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The GwNavAStar query held by the bot. |
get_remaining_distance_from_progress_to_end_of_path ( self ) : numberReturns the remaining distance from bot progress on path to end of path.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The remaining distance from bot progress on path to end of path. |
Or, nil if there's no path or GetProgressOnLivePathStatus is not valid.
init_astar_query ( self, astar, destination ) : booleanSetup a GwNavAStar like the one used by compute_astar_query_async.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
astar : | the GwNavAStar which will be initialized with this bot pathfinder settings. | |
destination : | The desired endpoint of the path. |
boolean |
Indicates if the query was sucessfully initialized |
It can then be set using GwNavAStar.set* functions, and it should preferably be computed using compute_path_async which keeps the Bot status updated with the running query, or run using GwNavAStar.compute_blocking and then set as path to follow using inject_path.
inject_path ( self, astar )Sets the path computed by an [GwNavAstar] to the specified GwNavBot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
astar : | The [GwNavAstar] that has computed the path to set. |
This function does not return any values. |
is_computing_path ( self ) : booleanPath computation is not a synchronous operation (it may complete in one frame or it may not).
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
boolean |
true if the bot is currently computing a path. |
As such this function allows us to know if the computation has finished.
is_following_path ( self ) : booleanReturns true is the specified bot has a path.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
boolean |
true if the bot currently has a path. |
is_path_recomputation_needed ( self ) : booleanReturns true if the bot needs to re-path because the path has been invalidated.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
boolean |
true if the bot needs to re-path because the path has been invalidated. |
navtag_layer_cost_table ( self ) : stingray.GwNavTagLayerCostTableRetrieves the GwNavTagLayerCostTable for this bot if any.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The GwNavTagLayerCostTable for this bot. |
Must be called before recomputing a Path to a new destination, typically when a new Target is selected by your own Bot logic.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
output_velocity ( self ) : stingray.Vector3If the specified GwNavBot has calculated a path, this function will return the desired velocity for this frame in order to follow this path.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The velocity that Navigation suggests should be applied for this bot. |
set_astar_try_can_go_mode ( self, try_can_go_mode )Set the pathfinder configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
try_can_go_mode : | Determines if thea RayCanGo query is ran before running an AStar query. |
This function does not return any values. |
set_avoidance_behavior ( self, enable_slowing, enable_forcing, enable_stop, stop_wait_time_s, forcing_time_s, forcing_wait_time_s )Sets the avoidance behavior configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
enable_slowing : | boolean | If set to true, velocity candidates with reduced speed will be considered; else only velocity candidate with Bot::GetDesiredSpeed() length will be considered. |
enable_forcing : | boolean | If set to true, solutions with collisions are allowed if no other solutions are found after a while. |
enable_stop : | boolean | If set to true, null velocity candidate will be considered; else the AvoidanceSolver will never consider stopping the Bot resulting in sometimes making it force its way through colliders. |
stop_wait_time_s : | number | If the entity stopped, wait this time in seconds before moving again. |
forcing_time_s : | number | If enable_forcing is true, passage is forced for at most this time in seconds only after forcing_wait_time_s seconds delay. |
forcing_wait_time_s : | number | If enable_forcing is true, passage will be forced after this time in seconds |
This function does not return any values. |
set_avoidance_collider_collector_configuration ( self, half_height, radius, frame_delay )Sets the avoidance collider collector configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
half_height : | number | Defines the height above and below the Bot altitude in which potential colliders will be collected. In meters. |
radius : | number | Defines the radius around the Bot in which potential colliders will be collected. In meters. |
frame_delay : | number | Defines the number of frames between two consecutive collection of potential colliders. |
This function does not return any values. |
set_avoidance_computer_configuration ( self, angle_span, time_to_collision, sample_count )Sets the avoidance computer configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
angle_span : | number | The span of the cone in front of the bot which the computer will use to calculate candidates in degrees. |
time_to_collision : | number | If an obstacle may collide in < time_to_collision seconds, take it into account. |
sample_count : | number | Avoidance computer sample count (e.g. how many samples within the cone specified by angle_span). |
This function does not return any values. |
set_channel_advanced_config ( self, turn_sampling_angle, channel_smoothing_angle, min_distance_between_gates, max_distance_between_gates )Sets the channel advanced configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
turn_sampling_angle : | number | Turns greater than this value will be split into equal fans. In degrees. |
channel_smoothing_angle : | number | The maximal angle of the Channel, taken with path edge direction as reference, when entering or quiting open space. Range: [1, 89]. |
min_distance_between_gates : | number | This distance defines minimum distance between two consecutive gates that are added during the widening between two "turn gates". |
max_distance_between_gates : | number | This distance defines maximum distance between two consecutive gates that are added during the widening between two "turn gates". |
This function does not return any values. |
set_channel_radius ( self, channel_radius )Sets the channel radius for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
channel_radius : | number | The distance between the path and the Channel borders. In meters. |
This function does not return any values. |
set_max_desired_linear_speed ( self, max_linear_speed )The specified bot will not exceed the specified speed when moving.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
max_linear_speed : | number | The maximum linear speed the bot can attain. |
This function does not return any values. |
set_navtag_layer_cost_table ( self, cost_table )Sets the GwNavTagLayerCostTable for this bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
cost_table : | The GwNavTagLayerCostTable to be used by this GwNavBot's GwNavTraverseLogicData. |
This function does not return any values. |
set_outside_navmesh_distance ( self, from_outside_navmesh_distance, to_outside_navmesh_distance )Sets the pathfinder configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
from_outside_navmesh_distance : | number | The maximum distance from the start along the X axis and along the Y axis that will be searched for NavMesh, if the start point is outside the NavMesh. The search looks for triangles in an axis-aligned bounding box around the start point, with a half extent on the x and y axes equal to from_outside_navmesh_distance. To disable this feature, you can set this value to 0.f |
to_outside_navmesh_distance : | number | The maximum distance from the destination along the X axis and along the Y axis that will be searched for NavMesh, if the destination point is outside the NavMesh. The search looks for triangles in an axis-aligned bounding box around the destination point, with a half extent on the x and y axes equal to to_outside_navmesh_distance. To disable this feature, you can set this value to 0.f |
This function does not return any values. |
set_propagation_box ( self, propagation_box_extent )Set the pathfinder configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
propagation_box_extent : | number | The distance between the propagation oriented 2d box boundaries and the [start, dest] segment. The astar propagation does not go outside the box. |
This function does not return any values. |
set_spline_trajectory_configuration ( self, animation_driven, max_distance_to_spline_position, spline_length, spline_distance_to_borders, spline_recomputation_ratio, target_on_spline_distance )Sets the spline trajectory configuration for the specified bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
animation_driven : | boolean | Choose whether you want to directly read your velocity from the spline or if you are animation driven instead. |
max_distance_to_spline_position : | number | If the bot is more than this distance in meters from its position on the spline, then the spline will be recomputed. |
spline_length : | number | The distance we look ahead on the channel when computing the spline. Should be greater than the longest straight line the bot will encounter on its path to avoid adding artificial turns due to myopia. |
spline_distance_to_borders : | number | The minimum ideal distance of the spline from the borders of the Channel (when there is sufficient room). |
spline_recomputation_ratio : | number | Once the bot has moved spline_length * spline_recomputation_ratio meters along the spline it will be recomputed. |
target_on_spline_distance : | number | The target is a point along the spline that is used to compute the final velocity. This parameter controls the distance this target is from the bot's position on the spline when animation_driven is true. When animation_driven is false the target position is as close as possible to the bot and this distance is therefore not used. |
This function does not return any values. |
set_use_avoidance ( self, use_avoidance )If this is set to false, the bot will ignore all other bots and obstacles and will not try to avoid them.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
use_avoidance : | boolean | Whether the bot should avoid other bots and obstacles or not. |
This function does not return any values. |
set_use_channel ( self, use_channel )If we set the bot to use the channel, it will use a more expensive, but more visually pleasing pathfollowing.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
use_channel : | boolean | Whether we use the channel or not. |
This function does not return any values. |
traverse_logic_data ( self ) : stingray.GwNavTraverseLogicDataRetrieves the GwNavTraverseLogicData for this bot.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The GwNavTraverseLogicData for this bot. |
update_logic_for_crowd_dispersion ( self ) : integerUpdates logic of this bot accordingly to crowd dispersion information, must be called each frame if crowd dispersion was enabled for this bot
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
integer |
it can be one of the following values: - 0: No action has to be taken - 1: A path must be recomputed in order to find an alternative - 2: If a path is being computed due to GameKitCrowdDispersionLogic_RecomputePath, it should be cancelled out. no action otherwise. |
update_position ( self, position, delta_time )Updates the current position of the specified GwNavBot
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
position : | The position of the game entity that the GwNavBot represents. | |
delta_time : | number | The time step that the GwNavBot should use when updating, in seconds. |
This function does not return any values. |
velocity ( self ) : stingray.Vector3If the specified GwNavBot moved since the last frame, this is the velocity it moved at.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The velocity that this bot is moving at since the last frame. |