unreal.MovementUtils¶
- class unreal.MovementUtils(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryMovementUtils: a collection of stateless static BP-accessible functions for a variety of movement-related operations
C++ Source:
Plugin: Mover
Module: Mover
File: MovementUtils.h
- classmethod can_escape_gravity(prior_velocity, new_velocity, gravity_accel, delta_seconds) bool¶
Checks whether a given velocity is strong enough to lift off against gravity
- classmethod compute_angular_velocity(from_, to, delta_seconds, turning_rate_limit=-1.000000) Rotator¶
Computes the angular velocity needed to change from one orientation to another within a time frame. Use the optional TurningRateLimit to clamp to a maximum step (negative=unlimited).
- classmethod compute_combined_velocity(params) Vector¶
Returns new velocity based on previous state, movement intent, movement mode’s influence and movement settings
- Parameters:
params (ComputeCombinedVelocityParams)
- Return type:
- classmethod compute_direction_intent(move_input, move_input_type) Vector¶
Computes the directional movement intent based on input vector and associated type
- Parameters:
move_input (Vector)
move_input_type (MoveInputType)
- Return type:
- classmethod compute_slide_delta(moving_comps, delta, pct_of_delta_to_move, normal, hit) Vector¶
Returns an alternative move delta to slide along a surface, based on parameters describing a blocked attempted move
- classmethod compute_velocity(params) Vector¶
Returns new ground-based velocity (worldspace) based on previous state, movement intent (worldspace), and movement settings
- Parameters:
params (ComputeVelocityParams)
- Return type:
- classmethod compute_velocity_from_gravity(gravity_accel, delta_seconds) Vector¶
Returns velocity (units per second) contributed by gravitational acceleration over a given time
- classmethod compute_velocity_from_positions(from_pos, to_pos, delta_seconds) Vector¶
Computes velocity based on start and end positions over time
- classmethod constrain_to_plane(vector, movement_plane, maintain_magnitude=True) Vector¶
Ensures input Vector (typically a velocity, acceleration, or move delta) is limited to a movement plane.
- classmethod get_gravity_vertical_component(vector, up_direction) Vector¶
Returns the component of the vector in the gravity-space vertical direction.
- classmethod is_angular_velocity_zero(angular_velocity) bool¶
Returns whether this rotator representing angular velocity has any non-zero values. This function exists due to FRotator::IsZero queries performing undesired wrapping and clamping.
- classmethod is_exceeding_max_speed(velocity, max_speed) bool¶
Checks whether a given velocity is exceeding a maximum speed, with some leeway to account for numeric imprecision
- classmethod project_to_gravity_floor(vector, up_direction) Vector¶
Project a vector onto the floor defined by the gravity direction.
- classmethod try_move_to_slide_along_surface(moving_comps, delta, pct_of_delta_to_move, rotation, normal, handle_impact) -> (float, hit=HitResult, move_record=MovementRecord)¶
Attempts to move a component along a surface. Returns the percent of time applied, with 0.0 meaning no movement occurred.
- classmethod try_safe_move_updated_component(moving_comps, delta, new_rotation, sweep, teleport) (out_hit=HitResult, move_record=MovementRecord) or None¶
Attempts to move a component and resolve any penetration issues with the proposed move Delta
- Parameters:
moving_comps (MovingComponentSet)
delta (Vector)
new_rotation (Quat)
sweep (bool)
teleport (TeleportType)
- Returns:
out_hit (HitResult):
move_record (MovementRecord):
- Return type:
tuple or None