PhysicsMovement ​
Inherits: ProjectileMovement < RefCounted
Physics-based movement strategy - ballistic trajectories with gravity Only works with PhysicalProjectileInstance that has RigidBody3D
Variables ​
Vector3 | target_position | |
bool | initial_velocity_applied | false |
Vector3 | initial_velocity | Vector3.ZERO |
bool | use_high_arc | false |
float | launch_angle_override | 0.0 |
Methods ​
void | set_use_high_arc( high_arc: bool ) |
void | set_launch_angle_override( angle_degrees: float ) |
float | get_launch_angle_degrees() |
Vector3 | get_current_velocity() |
float | get_current_actual_speed() |
Vector3 | get_initial_velocity() |
Dictionary | get_trajectory_info() |
bool | is_trajectory_valid() |
float | get_distance_to_target() |
Vector3 | get_current_direction() |
bool | wants_to_continue() |
void | cleanup() |
Variable descriptions ​
Vector3 target_position ​
Target position captured at launch (for ballistic calculation)
bool initial_velocity_applied = false ​
Whether the initial velocity has been applied
Vector3 initial_velocity = Vector3.ZERO ​
Initial velocity vector calculated for ballistic trajectory
bool use_high_arc = false ​
Whether to use high or low arc trajectory
float launch_angle_override = 0.0 ​
Launch angle override (if > 0, uses this instead of calculated angle)
Method descriptions ​
void set_use_high_arc( high_arc: bool ) ​
Set whether to use high arc trajectory
void set_launch_angle_override( angle_degrees: float ) ​
Set launch angle override (in degrees, 0 = auto-calculate)
float get_launch_angle_degrees() ​
Get calculated launch angle (in degrees)
Vector3 get_current_velocity() ​
Get current velocity from RigidBody3D
float get_current_actual_speed() ​
Get current speed from physics body
Vector3 get_initial_velocity() ​
Get initial velocity that was applied
Dictionary get_trajectory_info() ​
Get trajectory info for debugging
bool is_trajectory_valid() ​
Check if trajectory calculation was successful
float get_distance_to_target() ​
Override distance calculation to use captured target position
Vector3 get_current_direction() ​
Override current direction to use current velocity
bool wants_to_continue() ​
Physics movement doesn't need to continue after triggers
void cleanup() ​
Override cleanup to reset physics state