GSAISpecializedAgent (abstract)

Extends: GSAISteeringAgent < GSAIAgentLocation

Description

A base class for a specialized steering agent that updates itself every frame so the user does not have to. All other specialized agents derive from this.

Properties

TypeName
boolcalculate_velocities
boolapply_linear_drag
boolapply_angular_drag
floatlinear_drag_percentage
floatangular_drag_percentage

Functions

TypeName
voidfunc _apply_steering(_acceleration: GSAITargetAcceleration, _delta: float) -> void

Property Descriptions

calculate_velocities

var calculate_velocities: bool

If true, calculates linear and angular velocities based on the previous frame. When false, the user must keep those values updated.

apply_linear_drag

var apply_linear_drag: bool

If true, interpolates the current linear velocity towards 0 by the linear_drag_percentage value. Does not apply to RigidBody and RigidBody2D nodes.

apply_angular_drag

var apply_angular_drag: bool

If true, interpolates the current angular velocity towards 0 by the angular_drag_percentage value. Does not apply to RigidBody and RigidBody2D nodes.

linear_drag_percentage

var linear_drag_percentage: float

The percentage between the current linear velocity and 0 to interpolate by if apply_linear_drag is true. Does not apply to RigidBody and RigidBody2D nodes.

angular_drag_percentage

var angular_drag_percentage: float

The percentage between the current angular velocity and 0 to interpolate by if apply_angular_drag is true. Does not apply to RigidBody and RigidBody2D nodes.

Method Descriptions

_apply_steering (virtual)

func _apply_steering(_acceleration: GSAITargetAcceleration, _delta: float) -> void

Moves the agent’s body by target acceleration.