From ae3c3569ee597e4b9df14dfad5c4f7bfc5ad26e7 Mon Sep 17 00:00:00 2001 From: Francois Belair Date: Sun, 2 Feb 2020 12:48:58 -0500 Subject: [PATCH] Add `tags:` moniker for virtual functions Works with the docs maker accordingly --- project/reference.json | 2238 +++++++++++++++++ project/src/Behaviors/GSTAvoidCollisions.gd | 2 +- project/src/Behaviors/GSTCohesion.gd | 2 +- project/src/Behaviors/GSTSeparation.gd | 2 +- project/src/GSTGroupBehavior.gd | 2 +- .../src/Proximities/GSTInfiniteProximity.gd | 2 +- project/src/Proximities/GSTProximity.gd | 2 +- project/src/Proximities/GSTRadiusProximity.gd | 2 +- 8 files changed, 2245 insertions(+), 7 deletions(-) create mode 100644 project/reference.json diff --git a/project/reference.json b/project/reference.json new file mode 100644 index 0000000..1e9c8ba --- /dev/null +++ b/project/reference.json @@ -0,0 +1,2238 @@ +[ + { + "name": "GSTArrive", + "path": "res://src/Behaviors/GSTArrive.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTArrive", + "description": " Calculates acceleration to take an agent to its target's location. The\n calculation attempts to arrive with zero remaining velocity.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSTAgentLocation", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSTAgentLocation", + "description": " Target agent to arrive to.\n" + }, + { + "name": "arrival_tolerance", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var arrival_tolerance: float", + "description": " Distance from the target for the agent to be considered successfully\n arrived.\n" + }, + { + "name": "deceleration_radius", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var deceleration_radius: float", + "description": " Distance from the target for the agent to begin slowing down.\n" + }, + { + "name": "time_to_reach", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var time_to_reach: float", + "description": " Represents the time it takes to change acceleration.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTAgentLocation" + } + ] + }, + { + "name": "_arrive", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _arrive(acceleration: GSTTargetAcceleration, target_position: Vector3) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + }, + { + "name": "target_position", + "type": "Vector3" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTAvoidCollisions", + "path": "res://src/Behaviors/GSTAvoidCollisions.gd", + "extends_class": [ + "GSTGroupBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTAvoidCollisions", + "description": " Steers the agent to avoid obstacles in its path. Approximates obstacles as\n spheres.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "_first_neighbor", + "data_type": "GSTSteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _first_neighbor: GSTSteeringAgent", + "description": "" + }, + { + "name": "_shortest_time", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _shortest_time: float", + "description": "" + }, + { + "name": "_first_minimum_separation", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _first_minimum_separation: float", + "description": "" + }, + { + "name": "_first_distance", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _first_distance: float", + "description": "" + }, + { + "name": "_first_relative_position", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _first_relative_position: Vector3", + "description": "" + }, + { + "name": "_first_relative_velocity", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _first_relative_velocity: Vector3", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, proximity: GSTProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "proximity", + "type": "GSTProximity" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSTSteeringAgent) -> bool", + "description": " Callback for the proximity to call when finding neighbors. Keeps track of every `neighbor`\n that was found but only keeps the one the owning agent will most likely collide with.\n tags: virtual\n", + "arguments": [ + { + "name": "neighbor", + "type": "GSTSteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTBlend", + "path": "res://src/Behaviors/GSTBlend.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTBlend", + "description": " Blends multiple steering behaviors into one, and returns a weighted\n acceleration from their calculations.\n\n Stores the behaviors internally as dictionaries of the form\n {\n \tbehavior : GSTSteeringBehavior,\n \tweight : float\n }\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "_behaviors", + "data_type": "Array", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _behaviors: Array", + "description": "" + }, + { + "name": "_accel", + "data_type": "GSTTargetAcceleration", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _accel: GSTTargetAcceleration", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + } + ] + }, + { + "name": "add", + "return_type": "null", + "rpc_mode": 0, + "signature": "func add(behavior: GSTSteeringBehavior, weight: float) -> null", + "description": " Appends a behavior to the internal array along with its `weight`.\n", + "arguments": [ + { + "name": "behavior", + "type": "GSTSteeringBehavior" + }, + { + "name": "weight", + "type": "float" + } + ] + }, + { + "name": "get_behavior_at", + "return_type": "Dictionary", + "rpc_mode": 0, + "signature": "func get_behavior_at(index: int) -> Dictionary", + "description": " Returns the behavior at the specified `index`, or an empty `Dictionary` if\n none was found.\n", + "arguments": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(blended_accel: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "blended_accel", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTCohesion", + "path": "res://src/Behaviors/GSTCohesion.gd", + "extends_class": [ + "GSTGroupBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTCohesion", + "description": " Calculates an acceleration that attempts to move the agent towards the center\n of mass of the agents in the area defined by the `GSTProximity`.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "_center_of_mass", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _center_of_mass: Vector3", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, proximity: GSTProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "proximity", + "type": "GSTProximity" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSTSteeringAgent) -> bool", + "description": " Callback for the proximity to call when finding neighbors. Adds `neighbor`'s position\n to the center of mass of the group.\n tags: virtual\n", + "arguments": [ + { + "name": "neighbor", + "type": "GSTSteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTEvade", + "path": "res://src/Behaviors/GSTEvade.gd", + "extends_class": [ + "GSTPursue" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTEvade", + "description": " Calculates acceleration to take an agent away from where a target agent is\n moving.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "var", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTSteeringAgent, predict_time_max: float = 1)", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTSteeringAgent" + }, + { + "name": "predict_time_max", + "type": "float", + "default_value": 1 + } + ] + }, + { + "name": "_get_modified_acceleration", + "return_type": "float", + "rpc_mode": 0, + "signature": "func _get_modified_acceleration() -> float", + "description": "", + "arguments": [ + + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTFace", + "path": "res://src/Behaviors/GSTFace.gd", + "extends_class": [ + "GSTMatchOrientation" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTFace", + "description": " Calculates angular acceleration to rotate a target to face its target's\n position. The behavior attemps to arrive with zero remaining angular velocity.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTAgentLocation" + } + ] + }, + { + "name": "_face", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _face(acceleration: GSTTargetAcceleration, target_position: Vector3) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + }, + { + "name": "target_position", + "type": "Vector3" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTFlee", + "path": "res://src/Behaviors/GSTFlee.gd", + "extends_class": [ + "GSTSeek" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTFlee", + "description": " Calculates acceleration to take an agent directly away from a target agent.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTAgentLocation" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTFollowPath", + "path": "res://src/Behaviors/GSTFollowPath.gd", + "extends_class": [ + "GSTArrive" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTFollowPath", + "description": " Produces a linear acceleration that moves the agent along the specified path.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "path", + "data_type": "GSTPath", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var path: GSTPath", + "description": " The path to follow and travel along.\n" + }, + { + "name": "path_offset", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var path_offset: float", + "description": " The distance along the path to generate the next target position.\n" + }, + { + "name": "is_arrive_enabled", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var is_arrive_enabled: bool", + "description": " Whether to use `GSTArrive` behavior on an open path.\n" + }, + { + "name": "prediction_time", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var prediction_time: float", + "description": " The amount of time in the future to predict the owning agent's position along\n the path. Setting it to 0.0 will force non-predictive path following.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, path: GSTPath, path_offset: float = 0, prediction_time: float = 0) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "path", + "type": "GSTPath" + }, + { + "name": "path_offset", + "type": "float", + "default_value": 0 + }, + { + "name": "prediction_time", + "type": "float", + "default_value": 0 + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTLookWhereYouGo", + "path": "res://src/Behaviors/GSTLookWhereYouGo.gd", + "extends_class": [ + "GSTMatchOrientation" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTLookWhereYouGo", + "description": " Calculates an angular acceleration to match an agent's orientation to its\n direction of travel.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(accel: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTMatchOrientation", + "path": "res://src/Behaviors/GSTMatchOrientation.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTMatchOrientation", + "description": " Calculates an angular acceleration to match an agent's orientation to that of\n its target. Attempts to make the agent arrive with zero remaining angular\n velocity.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSTAgentLocation", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSTAgentLocation", + "description": " The target orientation for the behavior to try and match rotations to.\n" + }, + { + "name": "alignment_tolerance", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var alignment_tolerance: float", + "description": " The amount of distance in radians for the behavior to consider itself close\n enough to be matching the target agent's rotation.\n" + }, + { + "name": "deceleration_radius", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var deceleration_radius: float", + "description": " The amount of distance in radians from the goal to start slowing down.\n" + }, + { + "name": "time_to_reach", + "data_type": "float", + "default_value": 0.1, + "setter": "", + "getter": "", + "export": false, + "signature": "var time_to_reach: float = 0.1", + "description": " The amount of time to reach the target velocity\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTAgentLocation" + } + ] + }, + { + "name": "_match_orientation", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _match_orientation(acceleration: GSTTargetAcceleration, desired_orientation: float) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + }, + { + "name": "desired_orientation", + "type": "float" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTPriority", + "path": "res://src/Behaviors/GSTPriority.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTPriority", + "description": " Container for multiple behaviors that returns the result of the first child\n behavior with non-zero acceleration.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "_behaviors", + "data_type": "Array", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _behaviors: Array", + "description": "" + }, + { + "name": "last_selected_index", + "data_type": "int", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var last_selected_index: int", + "description": " The index of the last behavior the container prioritized.\n" + }, + { + "name": "zero_threshold", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var zero_threshold: float", + "description": " If a behavior's acceleration is lower than this threshold, the container\n considers it has an acceleration of zero.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, zero_threshold: float = 0.001) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "zero_threshold", + "type": "float", + "default_value": 0.001 + } + ] + }, + { + "name": "add", + "return_type": "null", + "rpc_mode": 0, + "signature": "func add(behavior: GSTSteeringBehavior) -> null", + "description": " Appends a steering behavior as a child of this container.\n", + "arguments": [ + { + "name": "behavior", + "type": "GSTSteeringBehavior" + } + ] + }, + { + "name": "get_behavior_at", + "return_type": "GSTSteeringBehavior", + "rpc_mode": 0, + "signature": "func get_behavior_at(index: int) -> GSTSteeringBehavior", + "description": " Returns the behavior at the position in the pool referred to by `index`, or\n `null` if no behavior was found.\n", + "arguments": [ + { + "name": "index", + "type": "int" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(accel: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTPursue", + "path": "res://src/Behaviors/GSTPursue.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTPursue", + "description": " Calculates an acceleration to make an agent intercept another based on the\n target agent's movement.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSTSteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSTSteeringAgent", + "description": " The target agent that the behavior is trying to intercept.\n" + }, + { + "name": "predict_time_max", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var predict_time_max: float", + "description": " The maximum amount of time in the future the behavior predicts the target's\n location.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTSteeringAgent, predict_time_max: float = 1) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTSteeringAgent" + }, + { + "name": "predict_time_max", + "type": "float", + "default_value": 1 + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + }, + { + "name": "_get_modified_acceleration", + "return_type": "float", + "rpc_mode": 0, + "signature": "func _get_modified_acceleration() -> float", + "description": "", + "arguments": [ + + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTSeek", + "path": "res://src/Behaviors/GSTSeek.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTSeek", + "description": " Calculates an acceleration to take an agent to a target agent's position\n directly.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSTAgentLocation", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSTAgentLocation", + "description": " The target that the behavior aims to move the agent to.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, target: GSTAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "target", + "type": "GSTAgentLocation" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTSeparation", + "path": "res://src/Behaviors/GSTSeparation.gd", + "extends_class": [ + "GSTGroupBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTSeparation", + "description": " Calculates an acceleration that repels the agent from its neighbors in the\n given `GSTProximity`.\n\n The acceleration is an average based on all neighbors, multiplied by a\n strength decreasing by the inverse square law in relation to distance, and it\n accumulates.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "decay_coefficient", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var decay_coefficient: float", + "description": " The coefficient to calculate how fast the separation strength decays with distance.\n" + }, + { + "name": "_acceleration", + "data_type": "GSTTargetAcceleration", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _acceleration: GSTTargetAcceleration", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, proximity: GSTProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "proximity", + "type": "GSTProximity" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSTSteeringAgent) -> bool", + "description": " Callback for the proximity to call when finding neighbors. Determines the amount of\n acceleration that `neighbor` imposes based on its distance from the owner agent.\n tags: virtual\n", + "arguments": [ + { + "name": "neighbor", + "type": "GSTSteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTAgentLocation", + "path": "res://src/GSTAgentLocation.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSTAgentLocation", + "description": " Represents an agent with only a location and an orientation.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "position", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var position: Vector3", + "description": " The agent's position in space.\n" + }, + { + "name": "orientation", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var orientation: float", + "description": " The agent's orientation on its Y axis rotation.\n" + } + ], + "signals": [ + + ], + "methods": [ + + ], + "static_functions": [ + + ] + }, + { + "name": "GSTGroupBehavior", + "path": "res://src/GSTGroupBehavior.gd", + "extends_class": [ + "GSTSteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTGroupBehavior", + "description": " Base type for group-based steering behaviors.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "proximity", + "data_type": "GSTProximity", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var proximity: GSTProximity", + "description": " Container to find neighbors of the agent and calculate group behavior.\n" + }, + { + "name": "_callback", + "data_type": "FuncRef", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _callback: FuncRef", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, proximity: GSTProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "proximity", + "type": "GSTProximity" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSTSteeringAgent) -> bool", + "description": " Internal callback for the behavior to define whether or not a member is\n relevant\n tags: virtual\n", + "arguments": [ + { + "name": "neighbor", + "type": "GSTSteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTPath", + "path": "res://src/GSTPath.gd", + "extends_class": [ + "Reference" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTPath", + "description": " Represents a path made up of Vector3 waypoints, split into segments path\n follow behaviors can use.\n", + "sub_classes": [ + { + "name": "GSTSegment", + "path": "res://src/GSTPath.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSTSegment", + "description": "", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "begin", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var begin: Vector3", + "description": "" + }, + { + "name": "end", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var end: Vector3", + "description": "" + }, + { + "name": "length", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var length: float", + "description": "" + }, + { + "name": "cumulative_length", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var cumulative_length: float", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(begin: Vector3, end: Vector3) -> null", + "description": "", + "arguments": [ + { + "name": "begin", + "type": "Vector3" + }, + { + "name": "end", + "type": "Vector3" + } + ] + } + ], + "static_functions": [ + + ] + } + ], + "constants": [ + + ], + "members": [ + { + "name": "is_open", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var is_open: bool", + "description": " If `false`, the path loops.\n" + }, + { + "name": "length", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var length: float", + "description": " Total length of the path.\n" + }, + { + "name": "_segments", + "data_type": "Array", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _segments: Array", + "description": "" + }, + { + "name": "_nearest_point_on_segment", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _nearest_point_on_segment: Vector3", + "description": "" + }, + { + "name": "_nearest_point_on_path", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _nearest_point_on_path: Vector3", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(waypoints: Array, is_open: bool = false) -> null", + "description": "", + "arguments": [ + { + "name": "waypoints", + "type": "Array" + }, + { + "name": "is_open", + "type": "bool", + "default_value": false + } + ] + }, + { + "name": "create_path", + "return_type": "null", + "rpc_mode": 0, + "signature": "func create_path(waypoints: Array) -> null", + "description": " Creates a path from a list of waypoints.\n", + "arguments": [ + { + "name": "waypoints", + "type": "Array" + } + ] + }, + { + "name": "calculate_distance", + "return_type": "float", + "rpc_mode": 0, + "signature": "func calculate_distance(agent_current_position: Vector3) -> float", + "description": " Returns the distance from `agent_current_position` to the next waypoint.\n", + "arguments": [ + { + "name": "agent_current_position", + "type": "Vector3" + } + ] + }, + { + "name": "calculate_target_position", + "return_type": "Vector3", + "rpc_mode": 0, + "signature": "func calculate_target_position(target_distance: float) -> Vector3", + "description": " Calculates a target position from the path's starting point based on the `target_distance`.\n", + "arguments": [ + { + "name": "target_distance", + "type": "float" + } + ] + }, + { + "name": "get_start_point", + "return_type": "Vector3", + "rpc_mode": 0, + "signature": "func get_start_point() -> Vector3", + "description": " Returns the position of the first point on the path.\n", + "arguments": [ + + ] + }, + { + "name": "get_end_point", + "return_type": "Vector3", + "rpc_mode": 0, + "signature": "func get_end_point() -> Vector3", + "description": " Returns the position of the last point on the path.\n", + "arguments": [ + + ] + }, + { + "name": "_calculate_point_segment_distance_squared", + "return_type": "float", + "rpc_mode": 0, + "signature": "func _calculate_point_segment_distance_squared(start: Vector3, end: Vector3, position: Vector3) -> float", + "description": "", + "arguments": [ + { + "name": "start", + "type": "Vector3" + }, + { + "name": "end", + "type": "Vector3" + }, + { + "name": "position", + "type": "Vector3" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTSteeringAgent", + "path": "res://src/GSTSteeringAgent.gd", + "extends_class": [ + "GSTAgentLocation" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTSteeringAgent", + "description": " Adds velocity, speed, and size data to `GSTAgentLocation`.\n\n It is the character's responsibility to keep this information up to date for\n the steering toolkit to work correctly.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "zero_linear_speed_threshold", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var zero_linear_speed_threshold: float", + "description": " The amount of velocity to be considered effectively not moving.\n" + }, + { + "name": "linear_speed_max", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var linear_speed_max: float", + "description": " The maximum speed at which the agent can move.\n" + }, + { + "name": "linear_acceleration_max", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var linear_acceleration_max: float", + "description": " The maximum amount of acceleration that any behavior can apply to the agent.\n" + }, + { + "name": "angular_speed_max", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var angular_speed_max: float", + "description": " The maximum amount of angular speed at which the agent can rotate.\n" + }, + { + "name": "angular_acceleration_max", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var angular_acceleration_max: float", + "description": " The maximum amount of angular acceleration that any behavior can apply to an\n agent.\n" + }, + { + "name": "linear_velocity", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var linear_velocity: Vector3", + "description": " Current velocity of the agent.\n" + }, + { + "name": "angular_velocity", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var angular_velocity: float", + "description": " Current angular velocity of the agent.\n" + }, + { + "name": "bounding_radius", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var bounding_radius: float", + "description": " The radius of the sphere that approximates the agent's size in space.\n" + }, + { + "name": "is_tagged", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var is_tagged: bool", + "description": " Used internally by group behaviors and proximities to mark the agent as already\n considered.\n" + } + ], + "signals": [ + + ], + "methods": [ + + ], + "static_functions": [ + + ] + }, + { + "name": "GSTSteeringBehavior", + "path": "res://src/GSTSteeringBehavior.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSTSteeringBehavior", + "description": " Base class for all steering behaviors.\n\n Steering behaviors calculate the linear and the angular acceleration to be\n to the agent that owns them.\n\n The `calculate_steering` function is the entry point for all behaviors.\n Individual steering behaviors encapsulate the steering logic.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "is_enabled", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var is_enabled: bool", + "description": " If `false`, all calculations return zero amounts of acceleration.\n" + }, + { + "name": "agent", + "data_type": "GSTSteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var agent: GSTSteeringAgent", + "description": " The AI agent on which the steering behavior bases its calculations.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + } + ] + }, + { + "name": "calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": " Returns the `acceleration` modified with the behavior's desired amount of\n acceleration.\n", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "GSTTargetAcceleration", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSTTargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTTargetAcceleration", + "path": "res://src/GSTTargetAcceleration.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSTTargetAcceleration", + "description": " A desired linear and angular amount of acceleration requested by the steering\n system.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "linear", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var linear: Vector3", + "description": " Linear acceleration\n" + }, + { + "name": "angular", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var angular: float", + "description": " Angular acceleration\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "set_zero", + "return_type": "null", + "rpc_mode": 0, + "signature": "func set_zero() -> null", + "description": " Sets the linear and angular components to 0.\n", + "arguments": [ + + ] + }, + { + "name": "add_scaled_accel", + "return_type": "null", + "rpc_mode": 0, + "signature": "func add_scaled_accel(accel: GSTTargetAcceleration, scalar: float) -> null", + "description": " Adds `accel`'s components, multiplied by `scalar`, to this one.\n", + "arguments": [ + { + "name": "accel", + "type": "GSTTargetAcceleration" + }, + { + "name": "scalar", + "type": "float" + } + ] + }, + { + "name": "get_magnitude_squared", + "return_type": "float", + "rpc_mode": 0, + "signature": "func get_magnitude_squared() -> float", + "description": " Returns the squared magnitude of the linear and angular components.\n", + "arguments": [ + + ] + }, + { + "name": "get_magnitude", + "return_type": "float", + "rpc_mode": 0, + "signature": "func get_magnitude() -> float", + "description": " Returns the magnitude of the linear and angular components.\n", + "arguments": [ + + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTUtils", + "path": "res://src/GSTUtils.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSTUtils", + "description": " Math and vector utility functions.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + + ], + "static_functions": [ + { + "name": "clampedv3", + "return_type": "Vector3", + "rpc_mode": 0, + "signature": "func clampedv3(vector: Vector3, limit: float) -> Vector3", + "description": " Returns the `vector` with its length capped to `limit`.\n", + "arguments": [ + { + "name": "vector", + "type": "Vector3" + }, + { + "name": "limit", + "type": "float" + } + ] + }, + { + "name": "vector3_to_angle", + "return_type": "float", + "rpc_mode": 0, + "signature": "func vector3_to_angle(vector: Vector3) -> float", + "description": " Returns an angle in radians between the positive X axis and the `vector`.\n\n This assumes orientation for 2D agents or 3D agents that are upright and\n rotate around the Y axis.\n", + "arguments": [ + { + "name": "vector", + "type": "Vector3" + } + ] + }, + { + "name": "angle_to_vector2", + "return_type": "Vector2", + "rpc_mode": 0, + "signature": "func angle_to_vector2(angle: float) -> Vector2", + "description": " Returns a directional vector from the given orientation angle.\n \n This assumes orientation for 2D agents or 3D agents that are upright and\n rotate around the Y axis.\n", + "arguments": [ + { + "name": "angle", + "type": "float" + } + ] + } + ] + }, + { + "name": "GSTInfiniteProximity", + "path": "res://src/Proximities/GSTInfiniteProximity.gd", + "extends_class": [ + "GSTProximity" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTInfiniteProximity", + "description": " Determines any agent that is in the specified list as being neighbors with the\n owner agent, regardless of distance.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, agents: Array) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "agents", + "type": "Array" + } + ] + }, + { + "name": "_find_neighbors", + "return_type": "int", + "rpc_mode": 0, + "signature": "func _find_neighbors(callback: FuncRef) -> int", + "description": " Returns a number of neighbors based on a `callback` function.\n\n `_find_neighbors` calls `callback` for each agent in the `agents` array and\n adds one to the count if its `callback` returns true.\n tags: virtual\n", + "arguments": [ + { + "name": "callback", + "type": "FuncRef" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTProximity", + "path": "res://src/Proximities/GSTProximity.gd", + "extends_class": [ + "Reference" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTProximity", + "description": " Base container type that stores data to find the neighbors of an agent.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "agent", + "data_type": "GSTSteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var agent: GSTSteeringAgent", + "description": " The owning agent whose neighbors are found in the group\n" + }, + { + "name": "agents", + "data_type": "Array", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var agents: Array", + "description": " The agents who are part of this group and could be potential neighbors\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, agents: Array) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "agents", + "type": "Array" + } + ] + }, + { + "name": "_find_neighbors", + "return_type": "int", + "rpc_mode": 0, + "signature": "func _find_neighbors(callback: FuncRef) -> int", + "description": " Returns a number of neighbors based on a `callback` function.\n\n `_find_neighbors` calls `callback` for each agent in the `agents` array and\n adds one to the count if its `callback` returns true.\n tags: virtual\n", + "arguments": [ + { + "name": "callback", + "type": "FuncRef" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSTRadiusProximity", + "path": "res://src/Proximities/GSTRadiusProximity.gd", + "extends_class": [ + "GSTProximity" + ], + "extends_file": "", + "icon": "", + "signature": "class GSTRadiusProximity", + "description": " Determines any agent that is in the specified list as being neighbors with the owner agent if\n they lie within the specified radius.\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "radius", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var radius: float", + "description": " The radius around the owning agent to find neighbors in\n" + }, + { + "name": "_last_frame", + "data_type": "int", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _last_frame: int", + "description": "" + }, + { + "name": "_scene_tree", + "data_type": "SceneTree", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _scene_tree: SceneTree", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSTSteeringAgent, agents: Array, radius: float) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSTSteeringAgent" + }, + { + "name": "agents", + "type": "Array" + }, + { + "name": "radius", + "type": "float" + } + ] + }, + { + "name": "_find_neighbors", + "return_type": "int", + "rpc_mode": 0, + "signature": "func _find_neighbors(callback: FuncRef) -> int", + "description": " Returns a number of neighbors based on a `callback` function.\n\n `_find_neighbors` calls `callback` for each agent in the `agents` array that lie within\n the radius around the owning agent and adds one to the count if its `callback` returns true.\n tags: virtual\n", + "arguments": [ + { + "name": "callback", + "type": "FuncRef" + } + ] + } + ], + "static_functions": [ + + ] + } +] \ No newline at end of file diff --git a/project/src/Behaviors/GSTAvoidCollisions.gd b/project/src/Behaviors/GSTAvoidCollisions.gd index 5389053..d00afc0 100644 --- a/project/src/Behaviors/GSTAvoidCollisions.gd +++ b/project/src/Behaviors/GSTAvoidCollisions.gd @@ -42,7 +42,7 @@ func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAccele # Callback for the proximity to call when finding neighbors. Keeps track of every `neighbor` # that was found but only keeps the one the owning agent will most likely collide with. -# virtual +# tags: virtual func _report_neighbor(neighbor: GSTSteeringAgent) -> bool: var relative_position := neighbor.position - agent.position var relative_velocity := neighbor.linear_velocity - agent.linear_velocity diff --git a/project/src/Behaviors/GSTCohesion.gd b/project/src/Behaviors/GSTCohesion.gd index 5c30a08..062cc43 100644 --- a/project/src/Behaviors/GSTCohesion.gd +++ b/project/src/Behaviors/GSTCohesion.gd @@ -23,7 +23,7 @@ func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAccele # Callback for the proximity to call when finding neighbors. Adds `neighbor`'s position # to the center of mass of the group. -# virtual +# tags: virtual func _report_neighbor(neighbor: GSTSteeringAgent) -> bool: _center_of_mass += neighbor.position return true diff --git a/project/src/Behaviors/GSTSeparation.gd b/project/src/Behaviors/GSTSeparation.gd index a069724..0a3252e 100644 --- a/project/src/Behaviors/GSTSeparation.gd +++ b/project/src/Behaviors/GSTSeparation.gd @@ -27,7 +27,7 @@ func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAccele # Callback for the proximity to call when finding neighbors. Determines the amount of # acceleration that `neighbor` imposes based on its distance from the owner agent. -# virtual +# tags: virtual func _report_neighbor(neighbor: GSTSteeringAgent) -> bool: var to_agent := agent.position - neighbor.position diff --git a/project/src/GSTGroupBehavior.gd b/project/src/GSTGroupBehavior.gd index b8ebacf..404be8d 100644 --- a/project/src/GSTGroupBehavior.gd +++ b/project/src/GSTGroupBehavior.gd @@ -15,6 +15,6 @@ func _init(agent: GSTSteeringAgent, proximity: GSTProximity).(agent) -> void: # Internal callback for the behavior to define whether or not a member is # relevant -# virtual +# tags: virtual func _report_neighbor(neighbor: GSTSteeringAgent) -> bool: return false diff --git a/project/src/Proximities/GSTInfiniteProximity.gd b/project/src/Proximities/GSTInfiniteProximity.gd index 4b34796..4453250 100644 --- a/project/src/Proximities/GSTInfiniteProximity.gd +++ b/project/src/Proximities/GSTInfiniteProximity.gd @@ -12,7 +12,7 @@ func _init(agent: GSTSteeringAgent, agents: Array).(agent, agents) -> void: # # `_find_neighbors` calls `callback` for each agent in the `agents` array and # adds one to the count if its `callback` returns true. -# virtual +# tags: virtual func _find_neighbors(callback: FuncRef) -> int: var neighbor_count := 0 var agent_count := agents.size() diff --git a/project/src/Proximities/GSTProximity.gd b/project/src/Proximities/GSTProximity.gd index eea52c2..9125537 100644 --- a/project/src/Proximities/GSTProximity.gd +++ b/project/src/Proximities/GSTProximity.gd @@ -18,6 +18,6 @@ func _init(agent: GSTSteeringAgent, agents: Array) -> void: # # `_find_neighbors` calls `callback` for each agent in the `agents` array and # adds one to the count if its `callback` returns true. -# virtual +# tags: virtual func _find_neighbors(callback: FuncRef) -> int: return 0 diff --git a/project/src/Proximities/GSTRadiusProximity.gd b/project/src/Proximities/GSTRadiusProximity.gd index 11ab650..5e457f5 100644 --- a/project/src/Proximities/GSTRadiusProximity.gd +++ b/project/src/Proximities/GSTRadiusProximity.gd @@ -20,7 +20,7 @@ func _init(agent: GSTSteeringAgent, agents: Array, radius: float).(agent, agents # # `_find_neighbors` calls `callback` for each agent in the `agents` array that lie within # the radius around the owning agent and adds one to the count if its `callback` returns true. -# virtual +# tags: virtual func _find_neighbors(callback: FuncRef) -> int: var agent_count := agents.size() var neighbor_count := 0