Skip to content

ParametricCurvedMovement ​

Inherits: DirectMovement < ProjectileMovement < RefCounted

Parametric curved movement strategy - uses mathematical curves with rotation control Extends DirectMovement but overrides movement logic for curved paths

Variables ​

CurveTypecurve_typeCurveType.STRAIGHT
floatcurve_amplitude2.0
floatcurve_frequency1.0
floatcurve_progress0.0
Vector3start_position
Vector3curve_direction
floattotal_distance
CurveRotationModecurve_rotation_modeCurveRotationMode.UP
floatfixed_curve_rotation0.0
floatrandom_rotation_range90.0
floatcurve_rotation0.0
booluse_left_curvefalse

Methods ​

boolwants_to_continue()
voidset_curve_type( type: int )
voidset_curve_amplitude( amplitude: float )
voidset_curve_frequency( frequency: float )
voidset_curve_rotation_mode( mode: CurveRotationMode )
voidset_fixed_curve_rotation( rotation_degrees: float )
voidset_random_rotation_range( range_degrees: float )
floatget_distance_to_target()
voidcleanup()

Enumerations ​

enum CurveType ​

The options of curve type: straight, arc, sine wave, spiral, bezier.

  • STRAIGHT = 0
  • ARC = 1
  • SINE_WAVE = 2
  • SPIRAL = 3

enum CurveRotationMode ​

The options of curve rotation mode: fixed, left, right, up, down, alternating, random full, random range.

  • FIXED = 0
  • LEFT = 1
  • RIGHT = 2
  • UP = 3
  • DOWN = 4
  • ALTERNATING = 5
  • RANDOM_FULL = 6

Variable descriptions ​

CurveType curve_type = CurveType.STRAIGHT ​

The shape of the curve the projectile follows.

float curve_amplitude = 2.0 ​

How pronounced the curve is

float curve_frequency = 1.0 ​

For wave patterns

float curve_progress = 0.0 ​

0.0 to 1.0 progress along path

Vector3 start_position ​

Starting position for curve calculations

Vector3 curve_direction ​

Base direction from start to target

float total_distance ​

Total distance to travel

CurveRotationMode curve_rotation_mode = CurveRotationMode.UP ​

How the curve is rotated for each projectile.

float fixed_curve_rotation = 0.0 ​

Degrees from UP

float random_rotation_range = 90.0 ​

Degrees of random variation

float curve_rotation = 0.0 ​

Calculated rotation in radians

bool use_left_curve = false ​

Set externally for alternating mode

Method descriptions ​

bool wants_to_continue() ​

Parametric curved movement doesn't need to continue after triggers

void set_curve_type( type: int ) ​

Set curve type

void set_curve_amplitude( amplitude: float ) ​

Set curve amplitude

void set_curve_frequency( frequency: float ) ​

Set curve frequency (for wave/spiral patterns)

void set_curve_rotation_mode( mode: CurveRotationMode ) ​

Set curve rotation mode

void set_fixed_curve_rotation( rotation_degrees: float ) ​

Set fixed curve rotation (in degrees)

void set_random_rotation_range( range_degrees: float ) ​

Set random rotation range (in degrees)

float get_distance_to_target() ​

Override to account for curved path

void cleanup() ​

Override cleanup to reset curve state