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 ​
CurveType | curve_type | CurveType.STRAIGHT |
float | curve_amplitude | 2.0 |
float | curve_frequency | 1.0 |
float | curve_progress | 0.0 |
Vector3 | start_position | |
Vector3 | curve_direction | |
float | total_distance | |
CurveRotationMode | curve_rotation_mode | CurveRotationMode.UP |
float | fixed_curve_rotation | 0.0 |
float | random_rotation_range | 90.0 |
float | curve_rotation | 0.0 |
bool | use_left_curve | false |
Methods ​
bool | wants_to_continue() |
void | set_curve_type( type: int ) |
void | set_curve_amplitude( amplitude: float ) |
void | set_curve_frequency( frequency: float ) |
void | set_curve_rotation_mode( mode: CurveRotationMode ) |
void | set_fixed_curve_rotation( rotation_degrees: float ) |
void | set_random_rotation_range( range_degrees: float ) |
float | get_distance_to_target() |
void | cleanup() |
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