diff --git a/CHANGELOG.md b/CHANGELOG.md index 67dbeb1..a6bb619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This document lists new features, improvements, changes, and bug fixes in every release of the add-on. +## Master ## + +- Acceleration for agents are multiplied by delta so values are acceleration per second. The demos' values have been increased significantly to compensate. + ## Godot Steering AI Framework 2.1.0 ## ### Features ### diff --git a/project/demos/Arrive/ArriveDemo.gd b/project/demos/Arrive/ArriveDemo.gd index a18b1c9..c18049b 100644 --- a/project/demos/Arrive/ArriveDemo.gd +++ b/project/demos/Arrive/ArriveDemo.gd @@ -1,7 +1,7 @@ extends Node -export (float, 0, 2000, 40) var linear_speed_max := 800.0 setget set_linear_speed_max -export (float, 0, 200, 2.0) var linear_acceleration_max := 80.0 setget set_linear_acceleration_max +export (float, 0, 3200, 100) var linear_speed_max := 800.0 setget set_linear_speed_max +export (float, 0, 10000, 100) var linear_acceleration_max := 80.0 setget set_linear_acceleration_max export (float, 0, 100, 0.1) var arrival_tolerance := 25.0 setget set_arrival_tolerance export (float, 0, 500, 10) var deceleration_radius := 125.0 setget set_deceleration_radius diff --git a/project/demos/Arrive/ArriveDemo.tscn b/project/demos/Arrive/ArriveDemo.tscn index 8b9ae3a..ab7af6a 100644 --- a/project/demos/Arrive/ArriveDemo.tscn +++ b/project/demos/Arrive/ArriveDemo.tscn @@ -12,6 +12,10 @@ radius = 23.2163 [node name="ArriveDemo" type="Node"] script = ExtResource( 3 ) +linear_speed_max = 1600.0 +linear_acceleration_max = 5000.0 +arrival_tolerance = 35.0 +deceleration_radius = 180.0 [node name="BackgroudLayer" parent="." instance=ExtResource( 4 )] diff --git a/project/demos/Arrive3d/Arrive3dDemo.tscn b/project/demos/Arrive3d/Arrive3dDemo.tscn index 4a4ca42..8b6a376 100644 --- a/project/demos/Arrive3d/Arrive3dDemo.tscn +++ b/project/demos/Arrive3d/Arrive3dDemo.tscn @@ -33,6 +33,11 @@ albedo_color = Color( 0.0941176, 0.235294, 0.486275, 1 ) [node name="Arrive3dDemo" type="Node"] script = ExtResource( 3 ) +linear_speed_max = 50.0 +linear_acceleration_max = 53.2 +deceleration_radius = 10.8 +angular_speed_max = 550 +angular_accel_max = 910 [node name="Arriver" type="KinematicBody" parent="."] script = ExtResource( 4 ) diff --git a/project/demos/Arrive3d/Seek3dDemo.gd b/project/demos/Arrive3d/Seek3dDemo.gd index 1844623..151ed7b 100644 --- a/project/demos/Arrive3d/Seek3dDemo.gd +++ b/project/demos/Arrive3d/Seek3dDemo.gd @@ -1,13 +1,13 @@ extends Node -export (float, 0, 50, 0.1) var linear_speed_max := 10.0 setget set_linear_speed_max -export (float, 0, 50, 0.1) var linear_acceleration_max := 1.0 setget set_linear_acceleration_max +export (float, 0, 100, 5) var linear_speed_max := 10.0 setget set_linear_speed_max +export (float, 0, 100, 0.1) var linear_acceleration_max := 1.0 setget set_linear_acceleration_max export (float, 0, 50, 0.1) var arrival_tolerance := 0.5 setget set_arrival_tolerance export (float, 0, 50, 0.1) var deceleration_radius := 5.0 setget set_deceleration_radius -export (int, 0, 359, 2) var angular_speed_max := 270 setget set_angular_speed_max -export (int, 0, 359, 2) var angular_accel_max := 45 setget set_angular_accel_max -export (int, 0, 180, 2) var align_tolerance := 5 setget set_align_tolerance -export (int, 0, 359, 2) var angular_deceleration_radius := 45 setget set_angular_deceleration_radius +export (int, 0, 1080, 10) var angular_speed_max := 270 setget set_angular_speed_max +export (int, 0, 2048, 10) var angular_accel_max := 45 setget set_angular_accel_max +export (int, 0, 178, 2) var align_tolerance := 5 setget set_align_tolerance +export (int, 0, 180, 2) var angular_deceleration_radius := 45 setget set_angular_deceleration_radius onready var target := $MouseTarget onready var arriver := $Arriver diff --git a/project/demos/AvoidCollisions/AvoidCollisionsDemo.gd b/project/demos/AvoidCollisions/AvoidCollisionsDemo.gd index 70db92b..f82b2a1 100644 --- a/project/demos/AvoidCollisions/AvoidCollisionsDemo.gd +++ b/project/demos/AvoidCollisions/AvoidCollisionsDemo.gd @@ -1,7 +1,7 @@ extends Node -export (float, 0, 2000, 40) var linear_speed_max := 350.0 setget set_linear_speed_max -export (float, 0, 100, 2) var linear_acceleration_max := 40.0 setget set_linear_accel_max +export (float, 0, 1000, 40) var linear_speed_max := 350.0 setget set_linear_speed_max +export (float, 0, 4000, 2) var linear_acceleration_max := 40.0 setget set_linear_accel_max export (float, 0, 500, 10) var proximity_radius := 140.0 setget set_proximity_radius export var draw_proximity := true setget set_draw_proximity diff --git a/project/demos/AvoidCollisions/AvoidCollisionsDemo.tscn b/project/demos/AvoidCollisions/AvoidCollisionsDemo.tscn index 5de0eda..5bf239e 100644 --- a/project/demos/AvoidCollisions/AvoidCollisionsDemo.tscn +++ b/project/demos/AvoidCollisions/AvoidCollisionsDemo.tscn @@ -8,7 +8,8 @@ [node name="AvoidCollisionsDemo" type="Node"] script = ExtResource( 2 ) -linear_speed_max = 400.0 +linear_speed_max = 520.0 +linear_acceleration_max = 2250.0 proximity_radius = 100.0 [node name="BackgroudLayer" parent="." instance=ExtResource( 5 )] diff --git a/project/demos/Face/FaceDemo.gd b/project/demos/Face/FaceDemo.gd index 667cd3f..282d941 100644 --- a/project/demos/Face/FaceDemo.gd +++ b/project/demos/Face/FaceDemo.gd @@ -1,7 +1,7 @@ extends Node -export (int, 0, 359, 2) var angular_speed_max := 120 setget set_angular_speed_max -export (int, 0, 359, 2) var angular_accel_max := 10 setget set_angular_accel_max +export (int, 0, 1080, 2) var angular_speed_max := 120 setget set_angular_speed_max +export (int, 0, 2048, 2) var angular_accel_max := 10 setget set_angular_accel_max export (int, 0, 180, 2) var align_tolerance := 5 setget set_align_tolerance export (int, 0, 359, 2) var deceleration_radius := 45 setget set_deceleration_radius export (float, 0, 1000, 40) var player_speed := 600.0 setget set_player_speed diff --git a/project/demos/Face/FaceDemo.tscn b/project/demos/Face/FaceDemo.tscn index 1e522db..348b293 100644 --- a/project/demos/Face/FaceDemo.tscn +++ b/project/demos/Face/FaceDemo.tscn @@ -15,8 +15,9 @@ radius = 37.1052 [node name="FaceDemo" type="Node"] script = ExtResource( 2 ) -angular_speed_max = 160 -angular_accel_max = 16 +angular_speed_max = 662 +angular_accel_max = 924 +deceleration_radius = 136 [node name="BackgroudLayer" parent="." instance=ExtResource( 5 )] diff --git a/project/demos/FollowPath/FollowPathDemo.gd b/project/demos/FollowPath/FollowPathDemo.gd index 1c340ec..cc26ce3 100644 --- a/project/demos/FollowPath/FollowPathDemo.gd +++ b/project/demos/FollowPath/FollowPathDemo.gd @@ -1,7 +1,7 @@ extends Node export (float, 0, 2000, 40) var linear_speed_max := 600.0 setget set_linear_speed_max -export (float, 0, 200, 10.0) var linear_acceleration_max := 40.0 setget set_linear_acceleration_max +export (float, 0, 9000, 10.0) var linear_acceleration_max := 40.0 setget set_linear_acceleration_max export (float, 0, 100, 0.1) var arrival_tolerance := 10.0 setget set_arrival_tolerance export (float, 0, 500, 10) var deceleration_radius := 100.0 setget set_deceleration_radius export (float, 0, 5, 0.1) var predict_time := 0.3 setget set_predict_time diff --git a/project/demos/FollowPath/FollowPathDemo.tscn b/project/demos/FollowPath/FollowPathDemo.tscn index 880e0fa..3935b61 100644 --- a/project/demos/FollowPath/FollowPathDemo.tscn +++ b/project/demos/FollowPath/FollowPathDemo.tscn @@ -12,7 +12,8 @@ radius = 24.1954 [node name="FollowPathDemo" type="Node"] script = ExtResource( 4 ) -linear_acceleration_max = 50.0 +linear_speed_max = 920.0 +linear_acceleration_max = 3740.0 deceleration_radius = 200.0 [node name="BackgroudLayer" parent="." instance=ExtResource( 5 )] diff --git a/project/demos/GroupBehaviors/GroupBehaviorsDemo.gd b/project/demos/GroupBehaviors/GroupBehaviorsDemo.gd index 7536792..51ab7ea 100644 --- a/project/demos/GroupBehaviors/GroupBehaviorsDemo.gd +++ b/project/demos/GroupBehaviors/GroupBehaviorsDemo.gd @@ -3,11 +3,11 @@ extends Node onready var spawner := $Spawner export (float, 0, 2000, 40.0) var linear_speed_max := 600.0 setget set_linear_speed_max -export (float, 0, 200, 2.0) var linear_accel_max := 40.0 setget set_linear_accel_max +export (float, 0, 9000, 2.0) var linear_accel_max := 40.0 setget set_linear_accel_max export (float, 0, 300, 2.0) var proximity_radius := 140.0 setget set_proximity_radius -export (float, 0, 10000, 100) var separation_decay_coefficient := 2000.0 setget set_separation_decay_coef +export (float, 0, 200000, 250) var separation_decay_coefficient := 2000.0 setget set_separation_decay_coef export (float, 0, 2, 0.1) var cohesion_strength := 0.1 setget set_cohesion_strength -export (float, 0, 6, 0.1) var separation_strength := 1.5 setget set_separation_strength +export (float, 0, 10, 0.2) var separation_strength := 1.5 setget set_separation_strength export var show_proximity_radius := true setget set_show_proximity_radius diff --git a/project/demos/GroupBehaviors/GroupBehaviorsDemo.tscn b/project/demos/GroupBehaviors/GroupBehaviorsDemo.tscn index 0fce222..b288389 100644 --- a/project/demos/GroupBehaviors/GroupBehaviorsDemo.tscn +++ b/project/demos/GroupBehaviors/GroupBehaviorsDemo.tscn @@ -8,8 +8,11 @@ [node name="GroupBehaviorsDemo" type="Node"] script = ExtResource( 3 ) +linear_accel_max = 4234.0 +proximity_radius = 158.0 +separation_decay_coefficient = 121500.0 cohesion_strength = 0.2 -separation_strength = 4.5 +separation_strength = 8.8 [node name="BackgroudLayer" parent="." instance=ExtResource( 5 )] diff --git a/project/demos/PursueSeek/PursueAndSeekDemo.gd b/project/demos/PursueSeek/PursueAndSeekDemo.gd index 13496bf..e888235 100644 --- a/project/demos/PursueSeek/PursueAndSeekDemo.gd +++ b/project/demos/PursueSeek/PursueAndSeekDemo.gd @@ -1,7 +1,7 @@ extends Node export (float, 0, 2000, 40) var linear_speed_max := 120.0 setget set_linear_speed_max -export (float, 0, 200, 2) var linear_accel_max := 10.0 setget set_linear_accel_max +export (float, 0, 2000, 20) var linear_accel_max := 10.0 setget set_linear_accel_max export (float, 0, 5, 0.1) var predict_time := 1.0 setget set_predict_time onready var pursuer := $BoundaryManager/Pursuer diff --git a/project/demos/PursueSeek/PursueAndSeekDemo.tscn b/project/demos/PursueSeek/PursueAndSeekDemo.tscn index f6b5b4e..f7417cc 100644 --- a/project/demos/PursueSeek/PursueAndSeekDemo.tscn +++ b/project/demos/PursueSeek/PursueAndSeekDemo.tscn @@ -10,8 +10,8 @@ [node name="PursueVSSeekDemo" type="Node"] script = ExtResource( 4 ) -linear_speed_max = 400.0 -linear_accel_max = 80.0 +linear_speed_max = 1280.0 +linear_accel_max = 1040.0 predict_time = 1.1 [node name="BackgroudLayer" parent="." instance=ExtResource( 7 )] diff --git a/project/demos/PursueSeek/Pursuer.gd b/project/demos/PursueSeek/Pursuer.gd index 553d752..04ebdf6 100644 --- a/project/demos/PursueSeek/Pursuer.gd +++ b/project/demos/PursueSeek/Pursuer.gd @@ -25,7 +25,7 @@ func _physics_process(delta: float) -> void: _blend.calculate_steering(accel) agent.angular_velocity = clamp( - agent.angular_velocity + accel.angular, -agent.angular_speed_max, agent.angular_speed_max + agent.angular_velocity + accel.angular * delta, -agent.angular_speed_max, agent.angular_speed_max ) agent.angular_velocity = lerp(agent.angular_velocity, 0, _angular_drag) @@ -33,7 +33,7 @@ func _physics_process(delta: float) -> void: var linear_velocity := ( GSAIUtils.to_vector2(agent.linear_velocity) - + (GSAIUtils.angle_to_vector2(rotation) * -agent.linear_acceleration_max) + + (GSAIUtils.angle_to_vector2(rotation) * -agent.linear_acceleration_max * delta) ) linear_velocity = linear_velocity.clamped(agent.linear_speed_max) linear_velocity = linear_velocity.linear_interpolate(Vector2.ZERO, _linear_drag_coefficient) @@ -51,14 +51,14 @@ func setup(predict_time: float, linear_speed_max: float, linear_accel_max: float var orient_behavior := GSAIFace.new(agent, _direction_face) orient_behavior.alignment_tolerance = deg2rad(5) - orient_behavior.deceleration_radius = deg2rad(5) + orient_behavior.deceleration_radius = deg2rad(30) _blend = GSAIBlend.new(agent) _blend.add(behavior, 1) _blend.add(orient_behavior, 1) - agent.angular_acceleration_max = deg2rad(40) - agent.angular_speed_max = deg2rad(90) + agent.angular_acceleration_max = deg2rad(1080) + agent.angular_speed_max = deg2rad(360) agent.linear_acceleration_max = linear_accel_max agent.linear_speed_max = linear_speed_max diff --git a/project/demos/Quickstart/Agent.gd b/project/demos/Quickstart/Agent.gd index ab017e1..5c90316 100644 --- a/project/demos/Quickstart/Agent.gd +++ b/project/demos/Quickstart/Agent.gd @@ -77,7 +77,7 @@ func _ready() -> void: # How close for the agent to be 'aligned', if not exact. face.alignment_tolerance = deg2rad(5) # When to start slowing down - face.deceleration_radius = deg2rad(45) + face.deceleration_radius = deg2rad(60) # LookWhereYouGo turns the agent to keep looking towards its direction of travel. It will only # be enabled while the agent is at low health. @@ -85,7 +85,7 @@ func _ready() -> void: # How close for the agent to be 'aligned', if not exact look.alignment_tolerance = deg2rad(5) # When to start slowing down. - look.deceleration_radius = deg2rad(45) + look.deceleration_radius = deg2rad(60) # Behaviors that are not enabled produce 0 acceleration. # Adding our fleeing behaviors to a blend. The order does not matter. @@ -118,7 +118,7 @@ func _physics_process(delta: float) -> void: # We add the discovered acceleration to our linear velocity. The toolkit does not limit # velocity, just acceleration, so we clamp the result ourselves here. - velocity = (velocity + Vector2(acceleration.linear.x, acceleration.linear.y)).clamped( + velocity = (velocity + Vector2(acceleration.linear.x, acceleration.linear.y) * delta).clamped( agent.linear_speed_max ) @@ -131,7 +131,7 @@ func _physics_process(delta: float) -> void: # We then do something similar to apply our agent's rotational speed. angular_velocity = clamp( - angular_velocity + acceleration.angular, -agent.angular_speed_max, agent.angular_speed_max + angular_velocity + acceleration.angular * delta, -agent.angular_speed_max, agent.angular_speed_max ) # This applies drag on the agent's rotation, helping it slow down naturally. angular_velocity = lerp(angular_velocity, 0, angular_drag) diff --git a/project/demos/Quickstart/Player.gd b/project/demos/Quickstart/Player.gd index a8160c3..40bcc4c 100644 --- a/project/demos/Quickstart/Player.gd +++ b/project/demos/Quickstart/Player.gd @@ -40,13 +40,13 @@ func _physics_process(delta: float) -> void: direction = GSAIUtils.angle_to_vector2(rotation) - velocity += direction * acceleration_max * movement + velocity += direction * acceleration_max * movement * delta velocity = velocity.clamped(speed_max) velocity = velocity.linear_interpolate(Vector2.ZERO, 0.1) velocity = move_and_slide(velocity) face.calculate_steering(accel) - angular_velocity += accel.angular + angular_velocity += accel.angular * delta angular_velocity = clamp(angular_velocity, -agent.angular_speed_max, agent.angular_speed_max) angular_velocity = lerp(angular_velocity, 0, 0.1) rotation += angular_velocity * delta diff --git a/project/demos/Quickstart/QuickStartDemo.tscn b/project/demos/Quickstart/QuickStartDemo.tscn index 17d2871..bbbca17 100644 --- a/project/demos/Quickstart/QuickStartDemo.tscn +++ b/project/demos/Quickstart/QuickStartDemo.tscn @@ -17,6 +17,10 @@ position = Vector2( 402.346, 573.791 ) rotation = 1.5708 collision_mask = 2 script = ExtResource( 3 ) +speed_max = 900.0 +acceleration_max = 4200.0 +rotation_speed_max = 360 +rotation_accel_max = 1280 bullet = ExtResource( 4 ) [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Player"] @@ -37,6 +41,10 @@ rotation = 1.5708 collision_layer = 2 collision_mask = 5 script = ExtResource( 2 ) +speed_max = 600.0 +acceleration_max = 2800.0 +angular_speed_max = 360 +angular_acceleration_max = 1280 [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Agent"] polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 ) diff --git a/project/demos/SeekFlee/SeekFleeDemo.gd b/project/demos/SeekFlee/SeekFleeDemo.gd index 8e632ae..027693c 100644 --- a/project/demos/SeekFlee/SeekFleeDemo.gd +++ b/project/demos/SeekFlee/SeekFleeDemo.gd @@ -4,8 +4,8 @@ extends Node enum Mode { FLEE, SEEK } export (Mode) var behavior_mode := Mode.SEEK setget set_behavior_mode -export (float, 0, 2000, 40) var linear_speed_max := 200.0 setget set_linear_speed_max -export (float, 0, 500, 0.5) var linear_accel_max := 10.0 setget set_linear_accel_max +export (float, 0, 1000, 30) var linear_speed_max := 200.0 setget set_linear_speed_max +export (float, 0, 2000, 40) var linear_accel_max := 10.0 setget set_linear_accel_max export (float) var player_speed := 600.0 setget set_player_speed var camera_boundaries: Rect2 diff --git a/project/demos/SeekFlee/SeekFleeDemo.tscn b/project/demos/SeekFlee/SeekFleeDemo.tscn index a17edec..974d3ed 100644 --- a/project/demos/SeekFlee/SeekFleeDemo.tscn +++ b/project/demos/SeekFlee/SeekFleeDemo.tscn @@ -20,6 +20,8 @@ extents = Vector2( 965.654, 10 ) [node name="SeekFleeDemo" type="Node"] script = ExtResource( 3 ) +linear_speed_max = 570.0 +linear_accel_max = 1160.0 [node name="BackgroudLayer" parent="." instance=ExtResource( 8 )] diff --git a/project/reference.json b/project/reference.json index 6fae0f7..fbb7bd9 100644 --- a/project/reference.json +++ b/project/reference.json @@ -1,2984 +1,3037 @@ -[ - { - "name": "GSAISteeringBehavior", - "path": "res://src/GSAISteeringBehavior.gd", - "extends_class": [ +{ + "name": "SteeringToolkit", + "description": "", + "version": null, + "classes": [ + { + "name": "GSAIKinematicBody2DAgent", + "path": "res://src/Agents/GSAIKinematicBody2DAgent.gd", + "extends_class": [ + "GSAISpecializedAgent" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIKinematicBody2DAgent", + "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a KinematicBody2D\n category: Specialized agents\n", + "sub_classes": [ - ], - "extends_file": "", - "icon": "", - "signature": "class GSAISteeringBehavior", - "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": "GSAISteeringAgent", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var agent: GSAISteeringAgent", - "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: GSAISteeringAgent) -> null", - "description": "", - "arguments": [ - { - "name": "_agent", - "type": "GSAISteeringAgent" - } - ] - }, - { - "name": "calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": " Sets the `acceleration` with the behavior's desired amount of acceleration.\n", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIRadiusProximity", - "path": "res://src/Proximities/GSAIRadiusProximity.gd", - "extends_class": [ - "GSAIProximity" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIRadiusProximity", - "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: GSAISteeringAgent, agents: Array, _radius: float) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" + ], + "constants": [ + { + "name": "MovementType", + "value": { + "SLIDE": 0, + "COLLIDE": 1, + "POSITION": 2 }, - { - "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": [ - - ] - }, - { - "name": "GSAIProximity", - "path": "res://src/Proximities/GSAIProximity.gd", - "extends_class": [ - "Reference" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIProximity", - "description": " Base container type that stores data to find the neighbors of an agent.\n", - "sub_classes": [ - - ], - "constants": [ - - ], - "members": [ - { - "name": "agent", - "data_type": "GSAISteeringAgent", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var agent: GSAISteeringAgent", - "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: GSAISteeringAgent, _agents: Array) -> null", - "description": "", - "arguments": [ - { - "name": "_agent", - "type": "GSAISteeringAgent" - }, - { - "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": "GSAIInfiniteProximity", - "path": "res://src/Proximities/GSAIInfiniteProximity.gd", - "extends_class": [ - "GSAIProximity" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIInfiniteProximity", - "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: GSAISteeringAgent, agents: Array) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "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": "GSAIGroupBehavior", - "path": "res://src/GSAIGroupBehavior.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIGroupBehavior", - "description": " Base type for group-based steering behaviors.\n", - "sub_classes": [ - - ], - "constants": [ - - ], - "members": [ - { - "name": "proximity", - "data_type": "GSAIProximity", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var proximity: GSAIProximity", - "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: GSAISteeringAgent, _proximity: GSAIProximity) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_proximity", - "type": "GSAIProximity" - } - ] - }, - { - "name": "_report_neighbor", - "return_type": "bool", - "rpc_mode": 0, - "signature": "func _report_neighbor(_neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIPath", - "path": "res://src/GSAIPath.gd", - "extends_class": [ - "Reference" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIPath", - "description": " Represents a path made up of Vector3 waypoints, split into segments path\n follow behaviors can use.\n", - "sub_classes": [ - { - "name": "GSAISegment", - "path": "res://src/GSAIPath.gd", - "extends_class": [ - - ], - "extends_file": "", - "icon": "", - "signature": "class GSAISegment", - "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": "GSAIFollowPath", - "path": "res://src/Behaviors/GSAIFollowPath.gd", - "extends_class": [ - "GSAIArrive" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIFollowPath", - "description": " Produces a linear acceleration that moves the agent along the specified path.\n", - "sub_classes": [ - - ], - "constants": [ - - ], - "members": [ - { - "name": "path", - "data_type": "GSAIPath", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var path: GSAIPath", - "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 `GSAIArrive` 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: GSAISteeringAgent, _path: GSAIPath, _path_offset: float = 0, _prediction_time: float = 0) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_path", - "type": "GSAIPath" - }, - { - "name": "_path_offset", - "type": "float", - "default_value": 0 - }, - { - "name": "_prediction_time", - "type": "float", - "default_value": 0 - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAISeparation", - "path": "res://src/Behaviors/GSAISeparation.gd", - "extends_class": [ - "GSAIGroupBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAISeparation", - "description": " Calculates an acceleration that repels the agent from its neighbors in the\n given `GSAIProximity`.\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": "GSAITargetAcceleration", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _acceleration: GSAITargetAcceleration", - "description": "" - } - ], - "signals": [ - - ], - "methods": [ - { - "name": "_init", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _init(agent: GSAISteeringAgent, proximity: GSAIProximity) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "proximity", - "type": "GSAIProximity" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - }, - { - "name": "_report_neighbor", - "return_type": "bool", - "rpc_mode": 0, - "signature": "func _report_neighbor(neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIMatchOrientation", - "path": "res://src/Behaviors/GSAIMatchOrientation.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIMatchOrientation", - "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": "GSAIAgentLocation", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var target: GSAIAgentLocation", - "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: GSAISteeringAgent, _target: GSAIAgentLocation) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_target", - "type": "GSAIAgentLocation" - } - ] - }, - { - "name": "_match_orientation", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _match_orientation(acceleration: GSAITargetAcceleration, desired_orientation: float) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "desired_orientation", - "type": "float" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIFlee", - "path": "res://src/Behaviors/GSAIFlee.gd", - "extends_class": [ - "GSAISeek" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIFlee", - "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: GSAISteeringAgent, target: GSAIAgentLocation) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "target", - "type": "GSAIAgentLocation" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAICohesion", - "path": "res://src/Behaviors/GSAICohesion.gd", - "extends_class": [ - "GSAIGroupBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAICohesion", - "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 `GSAIProximity`.\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: GSAISteeringAgent, proximity: GSAIProximity) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "proximity", - "type": "GSAIProximity" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - }, - { - "name": "_report_neighbor", - "return_type": "bool", - "rpc_mode": 0, - "signature": "func _report_neighbor(neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAILookWhereYouGo", - "path": "res://src/Behaviors/GSAILookWhereYouGo.gd", - "extends_class": [ - "GSAIMatchOrientation" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAILookWhereYouGo", - "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: GSAISteeringAgent) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(accel: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIArrive", - "path": "res://src/Behaviors/GSAIArrive.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIArrive", - "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": "GSAIAgentLocation", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var target: GSAIAgentLocation", - "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: GSAISteeringAgent, _target: GSAIAgentLocation) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_target", - "type": "GSAIAgentLocation" - } - ] - }, - { - "name": "_arrive", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _arrive(acceleration: GSAITargetAcceleration, target_position: Vector3) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "target_position", - "type": "Vector3" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIBlend", - "path": "res://src/Behaviors/GSAIBlend.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIBlend", - "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 : GSAISteeringBehavior,\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": "GSAITargetAcceleration", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _accel: GSAITargetAcceleration", - "description": "" - } - ], - "signals": [ - - ], - "methods": [ - { - "name": "_init", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _init(agent: GSAISteeringAgent) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - } - ] - }, - { - "name": "add", - "return_type": "null", - "rpc_mode": 0, - "signature": "func add(behavior: GSAISteeringBehavior, weight: float) -> null", - "description": " Appends a behavior to the internal array along with its `weight`.\n", - "arguments": [ - { - "name": "behavior", - "type": "GSAISteeringBehavior" - }, - { - "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": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(blended_accel: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "blended_accel", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIEvade", - "path": "res://src/Behaviors/GSAIEvade.gd", - "extends_class": [ - "GSAIPursue" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIEvade", - "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: GSAISteeringAgent, target: GSAISteeringAgent, predict_time_max: float = 1)", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "target", - "type": "GSAISteeringAgent" - }, - { - "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": "GSAIPriority", - "path": "res://src/Behaviors/GSAIPriority.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIPriority", - "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: GSAISteeringAgent, _zero_threshold: float = 0.001) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_zero_threshold", - "type": "float", - "default_value": 0.001 - } - ] - }, - { - "name": "add", - "return_type": "null", - "rpc_mode": 0, - "signature": "func add(behavior: GSAISteeringBehavior) -> null", - "description": " Appends a steering behavior as a child of this container.\n", - "arguments": [ - { - "name": "behavior", - "type": "GSAISteeringBehavior" - } - ] - }, - { - "name": "get_behavior_at", - "return_type": "GSAISteeringBehavior", - "rpc_mode": 0, - "signature": "func get_behavior_at(index: int) -> GSAISteeringBehavior", - "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": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(accel: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAISeek", - "path": "res://src/Behaviors/GSAISeek.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAISeek", - "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": "GSAIAgentLocation", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var target: GSAIAgentLocation", - "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: GSAISteeringAgent, _target: GSAIAgentLocation) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_target", - "type": "GSAIAgentLocation" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIFace", - "path": "res://src/Behaviors/GSAIFace.gd", - "extends_class": [ - "GSAIMatchOrientation" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIFace", - "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: GSAISteeringAgent, target: GSAIAgentLocation) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "target", - "type": "GSAIAgentLocation" - } - ] - }, - { - "name": "_face", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _face(acceleration: GSAITargetAcceleration, target_position: Vector3) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "target_position", - "type": "Vector3" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIAvoidCollisions", - "path": "res://src/Behaviors/GSAIAvoidCollisions.gd", - "extends_class": [ - "GSAIGroupBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIAvoidCollisions", - "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": "GSAISteeringAgent", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _first_neighbor: GSAISteeringAgent", - "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: GSAISteeringAgent, proximity: GSAIProximity) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "proximity", - "type": "GSAIProximity" - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - }, - { - "name": "_report_neighbor", - "return_type": "bool", - "rpc_mode": 0, - "signature": "func _report_neighbor(neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIPursue", - "path": "res://src/Behaviors/GSAIPursue.gd", - "extends_class": [ - "GSAISteeringBehavior" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIPursue", - "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": "GSAISteeringAgent", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var target: GSAISteeringAgent", - "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: GSAISteeringAgent, _target: GSAISteeringAgent, _predict_time_max: float = 1) -> null", - "description": "", - "arguments": [ - { - "name": "agent", - "type": "GSAISteeringAgent" - }, - { - "name": "_target", - "type": "GSAISteeringAgent" - }, - { - "name": "_predict_time_max", - "type": "float", - "default_value": 1 - } - ] - }, - { - "name": "_calculate_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", - "description": "", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - } - ] - }, - { - "name": "_get_modified_acceleration", - "return_type": "float", - "rpc_mode": 0, - "signature": "func _get_modified_acceleration() -> float", - "description": "", - "arguments": [ - - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAITargetAcceleration", - "path": "res://src/GSAITargetAcceleration.gd", - "extends_class": [ - - ], - "extends_file": "", - "icon": "", - "signature": "class GSAITargetAcceleration", - "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: GSAITargetAcceleration, scalar: float) -> null", - "description": " Adds `accel`'s components, multiplied by `scalar`, to this one.\n", - "arguments": [ - { - "name": "accel", - "type": "GSAITargetAcceleration" - }, - { - "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": "GSAIRigidBody2DAgent", - "path": "res://src/Agents/GSAIRigidBody2DAgent.gd", - "extends_class": [ - "GSAISpecializedAgent" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIRigidBody2DAgent", - "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a RigidBody2D\n", - "sub_classes": [ - - ], - "constants": [ - - ], - "members": [ - { - "name": "body", - "data_type": "RigidBody2D", - "default_value": null, - "setter": "_set_body", - "getter": "", - "export": false, - "signature": "var body: RigidBody2D", - "description": " The RigidBody2D to keep track of\n" - }, - { - "name": "_last_position", - "data_type": "Vector2", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _last_position: Vector2", - "description": "" - } - ], - "signals": [ - - ], - "methods": [ - { - "name": "_init", - "return_type": "var", - "rpc_mode": 0, - "signature": "func _init(_body: RigidBody2D) -> var", - "description": "", - "arguments": [ - { - "name": "_body", - "type": "RigidBody2D" - } - ] - }, - { - "name": "_apply_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, _delta: float) -> null", - "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "_delta", - "type": "float" - } - ] - }, - { - "name": "_set_body", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _set_body(value: RigidBody2D) -> null", - "description": "", - "arguments": [ - { - "name": "value", - "type": "RigidBody2D" - } - ] - }, - { - "name": "_on_body_ready", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _on_body_ready() -> null", - "description": "", - "arguments": [ - - ] - }, - { - "name": "_on_SceneTree_frame", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _on_SceneTree_frame() -> null", - "description": "", - "arguments": [ - - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIKinematicBody3DAgent", - "path": "res://src/Agents/GSAIKinematicBody3DAgent.gd", - "extends_class": [ - "GSAISpecializedAgent" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIKinematicBody3DAgent", - "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a KinematicBody\n", - "sub_classes": [ - - ], - "constants": [ - { - "name": "MovementType", - "value": { - "SLIDE": 0, - "COLLIDE": 1, - "POSITION": 2 + "data_type": "Dictionary", + "signature": "const MovementType: Dictionary = {\"COLLIDE\":1,\"POSITION\":2,\"SLIDE\":0}", + "description": "" + } + ], + "members": [ + { + "name": "body", + "data_type": "KinematicBody2D", + "default_value": null, + "setter": "_set_body", + "getter": "", + "export": false, + "signature": "var body: KinematicBody2D", + "description": " The KinematicBody2D to keep track of\n" }, - "data_type": "Dictionary", - "signature": "const MovementType: Dictionary = {\"COLLIDE\":1,\"POSITION\":2,\"SLIDE\":0}", - "description": "" - } - ], - "members": [ - { - "name": "body", - "data_type": "KinematicBody", - "default_value": null, - "setter": "_set_body", - "getter": "", - "export": false, - "signature": "var body: KinematicBody", - "description": " The KinematicBody to keep track of\n" - }, - { - "name": "movement_type", - "data_type": "int", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var movement_type: int", - "description": " The type of movement the body executes\n" - }, - { - "name": "_last_position", - "data_type": "Vector3", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _last_position: Vector3", - "description": "" - } - ], - "signals": [ - - ], - "methods": [ - { - "name": "_init", - "return_type": "var", - "rpc_mode": 0, - "signature": "func _init(_body: KinematicBody, _movement_type: int) -> var", - "description": "", - "arguments": [ - { - "name": "_body", - "type": "KinematicBody" - }, - { - "name": "_movement_type", - "type": "int" - } - ] - }, - { - "name": "_apply_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, delta: float) -> null", - "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_apply_sliding_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_sliding_steering(accel: Vector3) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "Vector3" - } - ] - }, - { - "name": "_apply_collide_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_collide_steering(accel: Vector3, delta: float) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "Vector3" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_apply_position_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_position_steering(accel: Vector3, delta: float) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "Vector3" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_apply_orientation_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_orientation_steering(angular_acceleration: float, delta: float) -> null", - "description": "", - "arguments": [ - { - "name": "angular_acceleration", - "type": "float" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_set_body", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _set_body(value: KinematicBody) -> null", - "description": "", - "arguments": [ - { - "name": "value", - "type": "KinematicBody" - } - ] - }, - { - "name": "_on_SceneTree_physics_frame", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _on_SceneTree_physics_frame() -> null", - "description": "", - "arguments": [ - - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAISpecializedAgent", - "path": "res://src/Agents/GSAISpecializedAgent.gd", - "extends_class": [ - "GSAISteeringAgent" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAISpecializedAgent", - "description": " A base class for a specialized steering agent that updates itself every frame\n so the user does not have to. All other specialized agents derive from this.\n tags: abstract\n", - "sub_classes": [ - - ], - "constants": [ - - ], - "members": [ - { - "name": "calculate_velocities", - "data_type": "bool", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var calculate_velocities: bool", - "description": " If `true`, calculates linear and angular velocities based on the previous\n frame. When `false`, the user must keep those values updated.\n" - }, - { - "name": "apply_linear_drag", - "data_type": "bool", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var apply_linear_drag: bool", - "description": " If `true`, interpolates the current linear velocity towards 0 by the \n `linear_drag_percentage` value.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" - }, - { - "name": "apply_angular_drag", - "data_type": "bool", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var apply_angular_drag: bool", - "description": " If `true`, interpolates the current angular velocity towards 0 by the\n `angular_drag_percentage` value.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" - }, - { - "name": "linear_drag_percentage", - "data_type": "float", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var linear_drag_percentage: float", - "description": " The percentage between the current linear velocity and 0 to interpolate by if\n `apply_linear_drag` is true.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" - }, - { - "name": "angular_drag_percentage", - "data_type": "float", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var angular_drag_percentage: float", - "description": " The percentage between the current angular velocity and 0 to interpolate by if\n `apply_angular_drag` is true.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" - }, - { - "name": "_last_orientation", - "data_type": "float", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _last_orientation: float", - "description": "" - }, - { - "name": "_body_type", - "data_type": "int", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _body_type: int", - "description": "" - }, - { - "name": "_applied_steering", - "data_type": "bool", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _applied_steering: bool", - "description": "" - } - ], - "signals": [ - - ], - "methods": [ - { - "name": "_apply_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_steering(_acceleration: GSAITargetAcceleration, _delta: float) -> null", - "description": " Moves the agent's body by target `acceleration`.\n tags: virtual\n", - "arguments": [ - { - "name": "_acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "_delta", - "type": "float" - } - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIRigidBody3DAgent", - "path": "res://src/Agents/GSAIRigidBody3DAgent.gd", - "extends_class": [ - "GSAISpecializedAgent" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIRigidBody3DAgent", - "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a RigidBody\n", - "sub_classes": [ - - ], - "constants": [ - - ], - "members": [ - { - "name": "body", - "data_type": "RigidBody", - "default_value": null, - "setter": "_set_body", - "getter": "", - "export": false, - "signature": "var body: RigidBody", - "description": " The RigidBody to keep track of\n" - }, - { - "name": "_last_position", - "data_type": "Vector3", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _last_position: Vector3", - "description": "" - } - ], - "signals": [ - - ], - "methods": [ - { - "name": "_init", - "return_type": "var", - "rpc_mode": 0, - "signature": "func _init(_body: RigidBody) -> var", - "description": "", - "arguments": [ - { - "name": "_body", - "type": "RigidBody" - } - ] - }, - { - "name": "_apply_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, _delta: float) -> null", - "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "_delta", - "type": "float" - } - ] - }, - { - "name": "_set_body", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _set_body(value: RigidBody) -> null", - "description": "", - "arguments": [ - { - "name": "value", - "type": "RigidBody" - } - ] - }, - { - "name": "_on_body_ready", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _on_body_ready() -> null", - "description": "", - "arguments": [ - - ] - }, - { - "name": "_on_SceneTree_frame", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _on_SceneTree_frame() -> null", - "description": "", - "arguments": [ - - ] - } - ], - "static_functions": [ - - ] - }, - { - "name": "GSAIKinematicBody2DAgent", - "path": "res://src/Agents/GSAIKinematicBody2DAgent.gd", - "extends_class": [ - "GSAISpecializedAgent" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIKinematicBody2DAgent", - "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a KinematicBody2D\n", - "sub_classes": [ - - ], - "constants": [ - { - "name": "MovementType", - "value": { - "SLIDE": 0, - "COLLIDE": 1, - "POSITION": 2 + { + "name": "movement_type", + "data_type": "int", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var movement_type: int", + "description": " The type of movement the body executes\n" }, - "data_type": "Dictionary", - "signature": "const MovementType: Dictionary = {\"COLLIDE\":1,\"POSITION\":2,\"SLIDE\":0}", - "description": "" - } - ], - "members": [ - { - "name": "body", - "data_type": "KinematicBody2D", - "default_value": null, - "setter": "_set_body", - "getter": "", - "export": false, - "signature": "var body: KinematicBody2D", - "description": " The KinematicBody2D to keep track of\n" - }, - { - "name": "movement_type", - "data_type": "int", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var movement_type: int", - "description": " The type of movement the body executes\n" - }, - { - "name": "_last_position", - "data_type": "Vector2", - "default_value": null, - "setter": "", - "getter": "", - "export": false, - "signature": "var _last_position: Vector2", - "description": "" - } - ], - "signals": [ + { + "name": "_last_position", + "data_type": "Vector2", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _last_position: Vector2", + "description": "" + }, + { + "name": "_body_ref", + "data_type": "WeakRef", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _body_ref: WeakRef", + "description": "" + } + ], + "signals": [ - ], - "methods": [ - { - "name": "_init", - "return_type": "var", - "rpc_mode": 0, - "signature": "func _init(_body: KinematicBody2D, _movement_type: int) -> var", - "description": "", - "arguments": [ - { - "name": "_body", - "type": "KinematicBody2D" + ], + "methods": [ + { + "name": "_init", + "return_type": "var", + "rpc_mode": 0, + "signature": "func _init(_body: KinematicBody2D, _movement_type: int) -> var", + "description": "", + "arguments": [ + { + "name": "_body", + "type": "KinematicBody2D" + }, + { + "name": "_movement_type", + "type": "int" + } + ] + }, + { + "name": "_apply_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, delta: float) -> null", + "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_apply_sliding_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_sliding_steering(accel: Vector3) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "Vector3" + } + ] + }, + { + "name": "_apply_collide_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_collide_steering(accel: Vector3, delta: float) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "Vector3" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_apply_position_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_position_steering(accel: Vector3, delta: float) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "Vector3" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_apply_orientation_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_orientation_steering(angular_acceleration: float, delta: float) -> null", + "description": "", + "arguments": [ + { + "name": "angular_acceleration", + "type": "float" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_set_body", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _set_body(value: KinematicBody2D) -> null", + "description": "", + "arguments": [ + { + "name": "value", + "type": "KinematicBody2D" + } + ] + }, + { + "name": "_on_SceneTree_physics_frame", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _on_SceneTree_physics_frame() -> null", + "description": "", + "arguments": [ + + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIKinematicBody3DAgent", + "path": "res://src/Agents/GSAIKinematicBody3DAgent.gd", + "extends_class": [ + "GSAISpecializedAgent" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIKinematicBody3DAgent", + "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a KinematicBody\n category: Specialized agents\n", + "sub_classes": [ + + ], + "constants": [ + { + "name": "MovementType", + "value": { + "SLIDE": 0, + "COLLIDE": 1, + "POSITION": 2 }, - { - "name": "_movement_type", - "type": "int" - } - ] - }, - { - "name": "_apply_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, delta: float) -> null", - "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", - "arguments": [ - { - "name": "acceleration", - "type": "GSAITargetAcceleration" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_apply_sliding_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_sliding_steering(accel: Vector3) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "Vector3" - } - ] - }, - { - "name": "_apply_collide_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_collide_steering(accel: Vector3, delta: float) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "Vector3" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_apply_position_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_position_steering(accel: Vector3, delta: float) -> null", - "description": "", - "arguments": [ - { - "name": "accel", - "type": "Vector3" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_apply_orientation_steering", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _apply_orientation_steering(angular_acceleration: float, delta: float) -> null", - "description": "", - "arguments": [ - { - "name": "angular_acceleration", - "type": "float" - }, - { - "name": "delta", - "type": "float" - } - ] - }, - { - "name": "_set_body", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _set_body(value: KinematicBody2D) -> null", - "description": "", - "arguments": [ - { - "name": "value", - "type": "KinematicBody2D" - } - ] - }, - { - "name": "_on_SceneTree_physics_frame", - "return_type": "null", - "rpc_mode": 0, - "signature": "func _on_SceneTree_physics_frame() -> null", - "description": "", - "arguments": [ + "data_type": "Dictionary", + "signature": "const MovementType: Dictionary = {\"COLLIDE\":1,\"POSITION\":2,\"SLIDE\":0}", + "description": "" + } + ], + "members": [ + { + "name": "body", + "data_type": "KinematicBody", + "default_value": null, + "setter": "_set_body", + "getter": "", + "export": false, + "signature": "var body: KinematicBody", + "description": " The KinematicBody to keep track of\n" + }, + { + "name": "movement_type", + "data_type": "int", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var movement_type: int", + "description": " The type of movement the body executes\n" + }, + { + "name": "_last_position", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _last_position: Vector3", + "description": "" + }, + { + "name": "_body_ref", + "data_type": "WeakRef", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _body_ref: WeakRef", + "description": "" + } + ], + "signals": [ - ] - } - ], - "static_functions": [ + ], + "methods": [ + { + "name": "_init", + "return_type": "var", + "rpc_mode": 0, + "signature": "func _init(_body: KinematicBody, _movement_type: int) -> var", + "description": "", + "arguments": [ + { + "name": "_body", + "type": "KinematicBody" + }, + { + "name": "_movement_type", + "type": "int" + } + ] + }, + { + "name": "_apply_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, delta: float) -> null", + "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_apply_sliding_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_sliding_steering(accel: Vector3) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "Vector3" + } + ] + }, + { + "name": "_apply_collide_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_collide_steering(accel: Vector3, delta: float) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "Vector3" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_apply_position_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_position_steering(accel: Vector3, delta: float) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "Vector3" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_apply_orientation_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_orientation_steering(angular_acceleration: float, delta: float) -> null", + "description": "", + "arguments": [ + { + "name": "angular_acceleration", + "type": "float" + }, + { + "name": "delta", + "type": "float" + } + ] + }, + { + "name": "_set_body", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _set_body(value: KinematicBody) -> null", + "description": "", + "arguments": [ + { + "name": "value", + "type": "KinematicBody" + } + ] + }, + { + "name": "_on_SceneTree_physics_frame", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _on_SceneTree_physics_frame() -> null", + "description": "", + "arguments": [ - ] - }, - { - "name": "GSAIUtils", - "path": "res://src/GSAIUtils.gd", - "extends_class": [ + ] + } + ], + "static_functions": [ - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIUtils", - "description": " Math and vector utility functions.\n", - "sub_classes": [ + ] + }, + { + "name": "GSAIRigidBody2DAgent", + "path": "res://src/Agents/GSAIRigidBody2DAgent.gd", + "extends_class": [ + "GSAISpecializedAgent" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIRigidBody2DAgent", + "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a RigidBody2D\n category: Specialized agents\n", + "sub_classes": [ - ], - "constants": [ + ], + "constants": [ - ], - "members": [ + ], + "members": [ + { + "name": "body", + "data_type": "RigidBody2D", + "default_value": null, + "setter": "_set_body", + "getter": "", + "export": false, + "signature": "var body: RigidBody2D", + "description": " The RigidBody2D to keep track of\n" + }, + { + "name": "_last_position", + "data_type": "Vector2", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _last_position: Vector2", + "description": "" + }, + { + "name": "_body_ref", + "data_type": "WeakRef", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _body_ref: WeakRef", + "description": "" + } + ], + "signals": [ - ], - "signals": [ + ], + "methods": [ + { + "name": "_init", + "return_type": "var", + "rpc_mode": 0, + "signature": "func _init(_body: RigidBody2D) -> var", + "description": "", + "arguments": [ + { + "name": "_body", + "type": "RigidBody2D" + } + ] + }, + { + "name": "_apply_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, _delta: float) -> null", + "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "_delta", + "type": "float" + } + ] + }, + { + "name": "_set_body", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _set_body(value: RigidBody2D) -> null", + "description": "", + "arguments": [ + { + "name": "value", + "type": "RigidBody2D" + } + ] + }, + { + "name": "_on_SceneTree_frame", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _on_SceneTree_frame() -> null", + "description": "", + "arguments": [ - ], - "methods": [ + ] + } + ], + "static_functions": [ - ], - "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": "to_vector2", - "return_type": "Vector2", - "rpc_mode": 0, - "signature": "func to_vector2(vector: Vector3) -> Vector2", - "description": " Returns a vector2 with `vector`'s x and y components.\n", - "arguments": [ - { - "name": "vector", - "type": "Vector3" - } - ] - }, - { - "name": "to_vector3", - "return_type": "Vector3", - "rpc_mode": 0, - "signature": "func to_vector3(vector: Vector2) -> Vector3", - "description": " Returns a vector3 with `vector`'s x and y components and 0 in z.\n", - "arguments": [ - { - "name": "vector", - "type": "Vector2" - } - ] - } - ] - }, - { - "name": "GSAISteeringAgent", - "path": "res://src/GSAISteeringAgent.gd", - "extends_class": [ - "GSAIAgentLocation" - ], - "extends_file": "", - "icon": "", - "signature": "class GSAISteeringAgent", - "description": " Adds velocity, speed, and size data to `GSAIAgentLocation`.\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": [ + ] + }, + { + "name": "GSAIRigidBody3DAgent", + "path": "res://src/Agents/GSAIRigidBody3DAgent.gd", + "extends_class": [ + "GSAISpecializedAgent" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIRigidBody3DAgent", + "description": " A specialized steering agent that updates itself every frame so the user does\n not have to using a RigidBody\n category: Specialized agents\n", + "sub_classes": [ - ], - "constants": [ + ], + "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": [ + ], + "members": [ + { + "name": "body", + "data_type": "RigidBody", + "default_value": null, + "setter": "_set_body", + "getter": "", + "export": false, + "signature": "var body: RigidBody", + "description": " The RigidBody to keep track of\n" + }, + { + "name": "_last_position", + "data_type": "Vector3", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _last_position: Vector3", + "description": "" + }, + { + "name": "_body_ref", + "data_type": "WeakRef", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _body_ref: WeakRef", + "description": "" + } + ], + "signals": [ - ], - "methods": [ + ], + "methods": [ + { + "name": "_init", + "return_type": "var", + "rpc_mode": 0, + "signature": "func _init(_body: RigidBody) -> var", + "description": "", + "arguments": [ + { + "name": "_body", + "type": "RigidBody" + } + ] + }, + { + "name": "_apply_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_steering(acceleration: GSAITargetAcceleration, _delta: float) -> null", + "description": " Moves the agent's `body` by target `acceleration`.\n tags: virtual\n", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "_delta", + "type": "float" + } + ] + }, + { + "name": "_set_body", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _set_body(value: RigidBody) -> null", + "description": "", + "arguments": [ + { + "name": "value", + "type": "RigidBody" + } + ] + }, + { + "name": "_on_SceneTree_frame", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _on_SceneTree_frame() -> null", + "description": "", + "arguments": [ - ], - "static_functions": [ + ] + } + ], + "static_functions": [ - ] - }, - { - "name": "GSAIAgentLocation", - "path": "res://src/GSAIAgentLocation.gd", - "extends_class": [ + ] + }, + { + "name": "GSAISpecializedAgent", + "path": "res://src/Agents/GSAISpecializedAgent.gd", + "extends_class": [ + "GSAISteeringAgent" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAISpecializedAgent", + "description": " A base class for a specialized steering agent that updates itself every frame\n so the user does not have to. All other specialized agents derive from this.\n category: Specialized agents\n tags: abstract\n", + "sub_classes": [ - ], - "extends_file": "", - "icon": "", - "signature": "class GSAIAgentLocation", - "description": " Represents an agent with only a location and an orientation.\n", - "sub_classes": [ + ], + "constants": [ - ], - "constants": [ + ], + "members": [ + { + "name": "calculate_velocities", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var calculate_velocities: bool", + "description": " If `true`, calculates linear and angular velocities based on the previous\n frame. When `false`, the user must keep those values updated.\n" + }, + { + "name": "apply_linear_drag", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var apply_linear_drag: bool", + "description": " If `true`, interpolates the current linear velocity towards 0 by the \n `linear_drag_percentage` value.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" + }, + { + "name": "apply_angular_drag", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var apply_angular_drag: bool", + "description": " If `true`, interpolates the current angular velocity towards 0 by the\n `angular_drag_percentage` value.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" + }, + { + "name": "linear_drag_percentage", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var linear_drag_percentage: float", + "description": " The percentage between the current linear velocity and 0 to interpolate by if\n `apply_linear_drag` is true.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" + }, + { + "name": "angular_drag_percentage", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var angular_drag_percentage: float", + "description": " The percentage between the current angular velocity and 0 to interpolate by if\n `apply_angular_drag` is true.\n Does not apply to `RigidBody` and `RigidBody2D` nodes.\n" + }, + { + "name": "_last_orientation", + "data_type": "float", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _last_orientation: float", + "description": "" + }, + { + "name": "_applied_steering", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _applied_steering: bool", + "description": "" + } + ], + "signals": [ - ], - "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": [ + { + "name": "_apply_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _apply_steering(_acceleration: GSAITargetAcceleration, _delta: float) -> null", + "description": " Moves the agent's body by target `acceleration`.\n tags: virtual\n", + "arguments": [ + { + "name": "_acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "_delta", + "type": "float" + } + ] + } + ], + "static_functions": [ - ], - "methods": [ + ] + }, + { + "name": "GSAIArrive", + "path": "res://src/Behaviors/GSAIArrive.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIArrive", + "description": " Calculates acceleration to take an agent to its target's location. The\n calculation attempts to arrive with zero remaining velocity.\n category: Individual behaviors\n", + "sub_classes": [ - ], - "static_functions": [ + ], + "constants": [ - ] - } -] \ No newline at end of file + ], + "members": [ + { + "name": "target", + "data_type": "GSAIAgentLocation", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSAIAgentLocation", + "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: GSAISteeringAgent, _target: GSAIAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_target", + "type": "GSAIAgentLocation" + } + ] + }, + { + "name": "_arrive", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _arrive(acceleration: GSAITargetAcceleration, target_position: Vector3) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "target_position", + "type": "Vector3" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIAvoidCollisions", + "path": "res://src/Behaviors/GSAIAvoidCollisions.gd", + "extends_class": [ + "GSAIGroupBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIAvoidCollisions", + "description": " Steers the agent to avoid obstacles in its path. Approximates obstacles as\n spheres.\n category: Group behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "_first_neighbor", + "data_type": "GSAISteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _first_neighbor: GSAISteeringAgent", + "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: GSAISteeringAgent, proximity: GSAIProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "proximity", + "type": "GSAIProximity" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIBlend", + "path": "res://src/Behaviors/GSAIBlend.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIBlend", + "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 : GSAISteeringBehavior,\n \tweight : float\n }\n category: Combination behaviors\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": "GSAITargetAcceleration", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _accel: GSAITargetAcceleration", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + } + ] + }, + { + "name": "add", + "return_type": "null", + "rpc_mode": 0, + "signature": "func add(behavior: GSAISteeringBehavior, weight: float) -> null", + "description": " Appends a behavior to the internal array along with its `weight`.\n", + "arguments": [ + { + "name": "behavior", + "type": "GSAISteeringBehavior" + }, + { + "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": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(blended_accel: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "blended_accel", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAICohesion", + "path": "res://src/Behaviors/GSAICohesion.gd", + "extends_class": [ + "GSAIGroupBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAICohesion", + "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 `GSAIProximity`.\n category: Group behaviors\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: GSAISteeringAgent, proximity: GSAIProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "proximity", + "type": "GSAIProximity" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIEvade", + "path": "res://src/Behaviors/GSAIEvade.gd", + "extends_class": [ + "GSAIPursue" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIEvade", + "description": " Calculates acceleration to take an agent away from where a target agent is\n moving.\n category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "var", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, target: GSAISteeringAgent, predict_time_max: float = 1)", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "target", + "type": "GSAISteeringAgent" + }, + { + "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": "GSAIFace", + "path": "res://src/Behaviors/GSAIFace.gd", + "extends_class": [ + "GSAIMatchOrientation" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIFace", + "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 category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, target: GSAIAgentLocation, use_z: bool = false) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "target", + "type": "GSAIAgentLocation" + }, + { + "name": "use_z", + "type": "bool", + "default_value": false + } + ] + }, + { + "name": "_face", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _face(acceleration: GSAITargetAcceleration, target_position: Vector3) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "target_position", + "type": "Vector3" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIFlee", + "path": "res://src/Behaviors/GSAIFlee.gd", + "extends_class": [ + "GSAISeek" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIFlee", + "description": " Calculates acceleration to take an agent directly away from a target agent.\n category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, target: GSAIAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "target", + "type": "GSAIAgentLocation" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIFollowPath", + "path": "res://src/Behaviors/GSAIFollowPath.gd", + "extends_class": [ + "GSAIArrive" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIFollowPath", + "description": " Produces a linear acceleration that moves the agent along the specified path.\n category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "path", + "data_type": "GSAIPath", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var path: GSAIPath", + "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 `GSAIArrive` 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: GSAISteeringAgent, _path: GSAIPath, _path_offset: float = 0, _prediction_time: float = 0) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_path", + "type": "GSAIPath" + }, + { + "name": "_path_offset", + "type": "float", + "default_value": 0 + }, + { + "name": "_prediction_time", + "type": "float", + "default_value": 0 + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAILookWhereYouGo", + "path": "res://src/Behaviors/GSAILookWhereYouGo.gd", + "extends_class": [ + "GSAIMatchOrientation" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAILookWhereYouGo", + "description": " Calculates an angular acceleration to match an agent's orientation to its\n direction of travel.\n category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, use_z: bool = false) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "use_z", + "type": "bool", + "default_value": false + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(accel: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIMatchOrientation", + "path": "res://src/Behaviors/GSAIMatchOrientation.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIMatchOrientation", + "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 category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSAIAgentLocation", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSAIAgentLocation", + "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" + }, + { + "name": "use_z", + "data_type": "bool", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var use_z: bool", + "description": " Whether to use the X and Z components instead of X and Y components when\n determining angles. X and Z should be used in 3D.\n" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, _target: GSAIAgentLocation, _use_z: bool = false) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_target", + "type": "GSAIAgentLocation" + }, + { + "name": "_use_z", + "type": "bool", + "default_value": false + } + ] + }, + { + "name": "_match_orientation", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _match_orientation(acceleration: GSAITargetAcceleration, desired_orientation: float) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + }, + { + "name": "desired_orientation", + "type": "float" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIPriority", + "path": "res://src/Behaviors/GSAIPriority.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIPriority", + "description": " Container for multiple behaviors that returns the result of the first child\n behavior with non-zero acceleration.\n category: Combination behaviors\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: GSAISteeringAgent, _zero_threshold: float = 0.001) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_zero_threshold", + "type": "float", + "default_value": 0.001 + } + ] + }, + { + "name": "add", + "return_type": "null", + "rpc_mode": 0, + "signature": "func add(behavior: GSAISteeringBehavior) -> null", + "description": " Appends a steering behavior as a child of this container.\n", + "arguments": [ + { + "name": "behavior", + "type": "GSAISteeringBehavior" + } + ] + }, + { + "name": "get_behavior_at", + "return_type": "GSAISteeringBehavior", + "rpc_mode": 0, + "signature": "func get_behavior_at(index: int) -> GSAISteeringBehavior", + "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": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(accel: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "accel", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIPursue", + "path": "res://src/Behaviors/GSAIPursue.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIPursue", + "description": " Calculates an acceleration to make an agent intercept another based on the\n target agent's movement.\n category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSAISteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSAISteeringAgent", + "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: GSAISteeringAgent, _target: GSAISteeringAgent, _predict_time_max: float = 1) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_target", + "type": "GSAISteeringAgent" + }, + { + "name": "_predict_time_max", + "type": "float", + "default_value": 1 + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + }, + { + "name": "_get_modified_acceleration", + "return_type": "float", + "rpc_mode": 0, + "signature": "func _get_modified_acceleration() -> float", + "description": "", + "arguments": [ + + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAISeek", + "path": "res://src/Behaviors/GSAISeek.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAISeek", + "description": " Calculates an acceleration to take an agent to a target agent's position\n directly.\n category: Individual behaviors\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "target", + "data_type": "GSAIAgentLocation", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var target: GSAIAgentLocation", + "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: GSAISteeringAgent, _target: GSAIAgentLocation) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_target", + "type": "GSAIAgentLocation" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAISeparation", + "path": "res://src/Behaviors/GSAISeparation.gd", + "extends_class": [ + "GSAIGroupBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAISeparation", + "description": " Calculates an acceleration that repels the agent from its neighbors in the\n given `GSAIProximity`.\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 category: Group behaviors\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": "GSAITargetAcceleration", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var _acceleration: GSAITargetAcceleration", + "description": "" + } + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, proximity: GSAIProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "proximity", + "type": "GSAIProximity" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIAgentLocation", + "path": "res://src/GSAIAgentLocation.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIAgentLocation", + "description": " Represents an agent with only a location and an orientation.\n category: Base types\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": "GSAIGroupBehavior", + "path": "res://src/GSAIGroupBehavior.gd", + "extends_class": [ + "GSAISteeringBehavior" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIGroupBehavior", + "description": " Base type for group-based steering behaviors.\n category: Base types\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "proximity", + "data_type": "GSAIProximity", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var proximity: GSAIProximity", + "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: GSAISteeringAgent, _proximity: GSAIProximity) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "name": "_proximity", + "type": "GSAIProximity" + } + ] + }, + { + "name": "_report_neighbor", + "return_type": "bool", + "rpc_mode": 0, + "signature": "func _report_neighbor(_neighbor: GSAISteeringAgent) -> 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": "GSAISteeringAgent" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAIPath", + "path": "res://src/GSAIPath.gd", + "extends_class": [ + "Reference" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIPath", + "description": " Represents a path made up of Vector3 waypoints, split into segments path\n follow behaviors can use.\n category: Base types\n", + "sub_classes": [ + { + "name": "GSAISegment", + "path": "res://src/GSAIPath.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSAISegment", + "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": "GSAISteeringAgent", + "path": "res://src/GSAISteeringAgent.gd", + "extends_class": [ + "GSAIAgentLocation" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAISteeringAgent", + "description": " Adds velocity, speed, and size data to `GSAIAgentLocation`.\n\n It is the character's responsibility to keep this information up to date for\n the steering toolkit to work correctly.\n category: Base types\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": "GSAISteeringBehavior", + "path": "res://src/GSAISteeringBehavior.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSAISteeringBehavior", + "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 category: Base types\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": "GSAISteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var agent: GSAISteeringAgent", + "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: GSAISteeringAgent) -> null", + "description": "", + "arguments": [ + { + "name": "_agent", + "type": "GSAISteeringAgent" + } + ] + }, + { + "name": "calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": " Sets the `acceleration` with the behavior's desired amount of acceleration.\n", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + }, + { + "name": "_calculate_steering", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _calculate_steering(acceleration: GSAITargetAcceleration) -> null", + "description": "", + "arguments": [ + { + "name": "acceleration", + "type": "GSAITargetAcceleration" + } + ] + } + ], + "static_functions": [ + + ] + }, + { + "name": "GSAITargetAcceleration", + "path": "res://src/GSAITargetAcceleration.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSAITargetAcceleration", + "description": " A desired linear and angular amount of acceleration requested by the steering\n system.\n category: Base types\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: GSAITargetAcceleration, scalar: float) -> null", + "description": " Adds `accel`'s components, multiplied by `scalar`, to this one.\n", + "arguments": [ + { + "name": "accel", + "type": "GSAITargetAcceleration" + }, + { + "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": "GSAIUtils", + "path": "res://src/GSAIUtils.gd", + "extends_class": [ + + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIUtils", + "description": " Math and vector utility functions.\n Category: Utilities\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 3D agents that are upright and rotate\n around the Y axis.\n", + "arguments": [ + { + "name": "vector", + "type": "Vector3" + } + ] + }, + { + "name": "vector2_to_angle", + "return_type": "float", + "rpc_mode": 0, + "signature": "func vector2_to_angle(vector: Vector2) -> float", + "description": " Returns an angle in radians between the positive X axis and the `vector`.\n", + "arguments": [ + { + "name": "vector", + "type": "Vector2" + } + ] + }, + { + "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": "to_vector2", + "return_type": "Vector2", + "rpc_mode": 0, + "signature": "func to_vector2(vector: Vector3) -> Vector2", + "description": " Returns a vector2 with `vector`'s x and y components.\n", + "arguments": [ + { + "name": "vector", + "type": "Vector3" + } + ] + }, + { + "name": "to_vector3", + "return_type": "Vector3", + "rpc_mode": 0, + "signature": "func to_vector3(vector: Vector2) -> Vector3", + "description": " Returns a vector3 with `vector`'s x and y components and 0 in z.\n", + "arguments": [ + { + "name": "vector", + "type": "Vector2" + } + ] + } + ] + }, + { + "name": "GSAIInfiniteProximity", + "path": "res://src/Proximities/GSAIInfiniteProximity.gd", + "extends_class": [ + "GSAIProximity" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIInfiniteProximity", + "description": " Determines any agent that is in the specified list as being neighbors with the\n owner agent, regardless of distance.\n category: Proximities\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + + ], + "signals": [ + + ], + "methods": [ + { + "name": "_init", + "return_type": "null", + "rpc_mode": 0, + "signature": "func _init(agent: GSAISteeringAgent, agents: Array) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "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": "GSAIProximity", + "path": "res://src/Proximities/GSAIProximity.gd", + "extends_class": [ + "Reference" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIProximity", + "description": " Base container type that stores data to find the neighbors of an agent.\n category: Proximities\n tags: abstract\n", + "sub_classes": [ + + ], + "constants": [ + + ], + "members": [ + { + "name": "agent", + "data_type": "GSAISteeringAgent", + "default_value": null, + "setter": "", + "getter": "", + "export": false, + "signature": "var agent: GSAISteeringAgent", + "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: GSAISteeringAgent, _agents: Array) -> null", + "description": "", + "arguments": [ + { + "name": "_agent", + "type": "GSAISteeringAgent" + }, + { + "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": "GSAIRadiusProximity", + "path": "res://src/Proximities/GSAIRadiusProximity.gd", + "extends_class": [ + "GSAIProximity" + ], + "extends_file": "", + "icon": "", + "signature": "class GSAIRadiusProximity", + "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 category: Proximities\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: GSAISteeringAgent, agents: Array, _radius: float) -> null", + "description": "", + "arguments": [ + { + "name": "agent", + "type": "GSAISteeringAgent" + }, + { + "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/Agents/GSAIKinematicBody2DAgent.gd b/project/src/Agents/GSAIKinematicBody2DAgent.gd index e8dda61..171e110 100644 --- a/project/src/Agents/GSAIKinematicBody2DAgent.gd +++ b/project/src/Agents/GSAIKinematicBody2DAgent.gd @@ -38,19 +38,19 @@ func _apply_steering(acceleration: GSAITargetAcceleration, delta: float) -> void MovementType.COLLIDE: _apply_collide_steering(acceleration.linear, delta) MovementType.SLIDE: - _apply_sliding_steering(acceleration.linear) + _apply_sliding_steering(acceleration.linear, delta) _: _apply_position_steering(acceleration.linear, delta) _apply_orientation_steering(acceleration.angular, delta) -func _apply_sliding_steering(accel: Vector3) -> void: +func _apply_sliding_steering(accel: Vector3, delta: float) -> void: var _body: KinematicBody2D = _body_ref.get_ref() if not _body: return - var velocity := GSAIUtils.to_vector2(linear_velocity + accel).clamped(linear_speed_max) + var velocity := GSAIUtils.to_vector2(linear_velocity + accel * delta).clamped(linear_speed_max) if apply_linear_drag: velocity = velocity.linear_interpolate(Vector2.ZERO, linear_drag_percentage) velocity = _body.move_and_slide(velocity) @@ -63,7 +63,7 @@ func _apply_collide_steering(accel: Vector3, delta: float) -> void: if not _body: return - var velocity := GSAIUtils.clampedv3(linear_velocity + accel, linear_speed_max) + var velocity := GSAIUtils.clampedv3(linear_velocity + accel * delta, linear_speed_max) if apply_linear_drag: velocity = velocity.linear_interpolate(Vector3.ZERO, linear_drag_percentage) # warning-ignore:return_value_discarded @@ -77,7 +77,7 @@ func _apply_position_steering(accel: Vector3, delta: float) -> void: if not _body: return - var velocity := GSAIUtils.clampedv3(linear_velocity + accel, linear_speed_max) + var velocity := GSAIUtils.clampedv3(linear_velocity + accel * delta, linear_speed_max) if apply_linear_drag: velocity = velocity.linear_interpolate(Vector3.ZERO, linear_drag_percentage) _body.global_position += GSAIUtils.to_vector2(velocity) * delta @@ -90,7 +90,11 @@ func _apply_orientation_steering(angular_acceleration: float, delta: float) -> v if not _body: return - var velocity = angular_velocity + angular_acceleration + var velocity = clamp( + angular_velocity + angular_acceleration * delta, + -angular_acceleration_max, + angular_acceleration_max + ) if apply_angular_drag: velocity = lerp(velocity, 0, angular_drag_percentage) _body.rotation += velocity * delta diff --git a/project/src/Agents/GSAIKinematicBody3DAgent.gd b/project/src/Agents/GSAIKinematicBody3DAgent.gd index 7e6cb77..62b3658 100644 --- a/project/src/Agents/GSAIKinematicBody3DAgent.gd +++ b/project/src/Agents/GSAIKinematicBody3DAgent.gd @@ -38,19 +38,19 @@ func _apply_steering(acceleration: GSAITargetAcceleration, delta: float) -> void MovementType.COLLIDE: _apply_collide_steering(acceleration.linear, delta) MovementType.SLIDE: - _apply_sliding_steering(acceleration.linear) + _apply_sliding_steering(acceleration.linear, delta) _: _apply_position_steering(acceleration.linear, delta) _apply_orientation_steering(acceleration.angular, delta) -func _apply_sliding_steering(accel: Vector3) -> void: +func _apply_sliding_steering(accel: Vector3, delta: float) -> void: var _body: KinematicBody = _body_ref.get_ref() if not _body: return - var velocity := GSAIUtils.clampedv3(linear_velocity + accel, linear_speed_max) + var velocity := GSAIUtils.clampedv3(linear_velocity + accel * delta, linear_speed_max) if apply_linear_drag: velocity = velocity.linear_interpolate(Vector3.ZERO, linear_drag_percentage) velocity = _body.move_and_slide(velocity) @@ -63,7 +63,7 @@ func _apply_collide_steering(accel: Vector3, delta: float) -> void: if not _body: return - var velocity := GSAIUtils.clampedv3(linear_velocity + accel, linear_speed_max) + var velocity := GSAIUtils.clampedv3(linear_velocity + accel * delta, linear_speed_max) if apply_linear_drag: velocity = velocity.linear_interpolate(Vector3.ZERO, linear_drag_percentage) # warning-ignore:return_value_discarded @@ -77,7 +77,7 @@ func _apply_position_steering(accel: Vector3, delta: float) -> void: if not _body: return - var velocity := GSAIUtils.clampedv3(linear_velocity + accel, linear_speed_max) + var velocity := GSAIUtils.clampedv3(linear_velocity + accel * delta, linear_speed_max) if apply_linear_drag: velocity = velocity.linear_interpolate(Vector3.ZERO, linear_drag_percentage) _body.global_position += velocity * delta @@ -90,7 +90,11 @@ func _apply_orientation_steering(angular_acceleration: float, delta: float) -> v if not _body: return - var velocity = angular_velocity + angular_acceleration + var velocity = clamp( + angular_velocity + angular_acceleration * delta, + -angular_acceleration_max, + angular_acceleration_max + ) if apply_angular_drag: velocity = lerp(velocity, 0, angular_drag_percentage) _body.rotation.y += velocity * delta