unreal.BlueprintSpringMathLibrary¶
- class unreal.BlueprintSpringMathLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryBlueprint Spring Math Library
C++ Source:
Module: Engine
File: BlueprintSpringMathLibrary.h
- classmethod convert_half_life_to_smoothing_time(half_life) float¶
Convert a halflife to a smoothing time
- Parameters:
half_life (float) – The half life of the spring. How long it takes the value to get halfway towards the target.
- Returns:
The smoothing time of the spring in seconds. It is the time by which the output lags the input when critically damped, when the input is changing at a constant rate.
- Return type:
- classmethod convert_smoothing_time_to_half_life(smoothing_time) float¶
Convert a smoothing time to a half life
- Parameters:
smoothing_time (float) – The smoothing time of the spring in seconds. It is the time by which the output lags the input when critically damped, when the input is changing at a constant rate.
- Returns:
The half life of the spring. How long it takes the value to get halfway towards the target.
- Return type:
- classmethod convert_smoothing_time_to_strength(smoothing_time) float¶
Convert from smoothing time to spring strength.
- Parameters:
smoothing_time (float) – The smoothing time of the spring in seconds. It is the time by which the output lags the input when critically damped, when the input is changing at a constant rate.
- Returns:
The spring strength. This corresponds to the undamped frequency of the spring in hz.
- Return type:
- classmethod convert_strength_to_smoothing_time(strength) float¶
Convert from spring strength to smoothing time.
- Parameters:
strength (float) – The spring strength. This corresponds to the undamped frequency of the spring in hz.
- Returns:
The smoothing time of the spring in seconds. It is the time by which the output lags the input when critically damped, when the input is changing at a constant rate.
- Return type:
- classmethod critical_double_spring_damp_angle(out_angle, out_angular_velocity, out_intermediate_angle, out_intermediate_angular_velocity, target_angle, delta_time, smoothing_time=0.200000) -> (out_angle=float, out_angular_velocity=float, out_intermediate_angle=float, out_intermediate_angular_velocity=float)¶
Interpolates the angle InOutAngle towards TargetAngle using a critically damped spring via an intermediate state - producing a more S-shaped curve. The velocity of InOutAngle is stored in InOutAngularVelocity in deg/s.
- Parameters:
out_angle (float) – The value to be damped in degrees
out_angular_velocity (float) – The speed of the value to be damped in deg/s
out_intermediate_angle (float) – The intermediate state of the double spring
out_intermediate_angular_velocity (float) – The intermediate velocity of the double spring
target_angle (float) – The goal to damp towards in degrees
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutAngle to TargetAngle
- Returns:
out_angle (float): The value to be damped in degrees
out_angular_velocity (float): The speed of the value to be damped in deg/s
out_intermediate_angle (float): The intermediate state of the double spring
out_intermediate_angular_velocity (float): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_double_spring_damp_float(out_x, out_v, out_xi, out_vi, target_x, delta_time, smoothing_time=0.200000) -> (out_x=float, out_v=float, out_xi=float, out_vi=float)¶
Interpolates the value InOutX towards TargetX using a critically damped spring via an intermediate state - producing a more S-shaped curve. The velocity of X is stored in InOutV.
- Parameters:
out_x (float) – The value to be damped
out_v (float) – The speed of the value to be damped
out_xi (float) – The intermediate state of the double spring
out_vi (float) – The intermediate velocity of the double spring
target_x (float) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX
- Returns:
out_x (float): The value to be damped
out_v (float): The speed of the value to be damped
out_xi (float): The intermediate state of the double spring
out_vi (float): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_double_spring_damp_quat(out_rotation, out_angular_velocity, out_intermediate_rotation, out_intermediate_angular_velocity, target_rotation, delta_time, smoothing_time=0.200000) -> (out_rotation=Quat, out_angular_velocity=Vector, out_intermediate_rotation=Quat, out_intermediate_angular_velocity=Vector)¶
Interpolates the value InOutRotation towards TargetRotation using a critically damped spring via an intermediate state - producing a more S-shaped curve. The velocity of InOutRotation is stored in InOutAngularVelocity in deg/s.
- Parameters:
out_rotation (Quat) – The value to be damped
out_angular_velocity (Vector) – The speed of the value to be damped in deg/s
out_intermediate_rotation (Quat) – The intermediate state of the double spring
out_intermediate_angular_velocity (Vector) – The intermediate velocity of the double spring
target_rotation (Quat) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutRotation to TargetRotation
- Returns:
out_rotation (Quat): The value to be damped
out_angular_velocity (Vector): The speed of the value to be damped in deg/s
out_intermediate_rotation (Quat): The intermediate state of the double spring
out_intermediate_angular_velocity (Vector): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_double_spring_damp_rotator(out_rotation, out_angular_velocity, out_intermediate_rotation, out_intermediate_angular_velocity, target_rotation, delta_time, smoothing_time=0.200000) -> (out_rotation=Rotator, out_angular_velocity=Vector, out_intermediate_rotation=Rotator, out_intermediate_angular_velocity=Vector)¶
Interpolates the value InOutRotation towards TargetRotation using a critically damped spring via an intermediate value - producing a more S-shaped curve. The velocity of InOutRotation is stored in InOutAngularVelocity in deg/s.
- Parameters:
out_rotation (Rotator) – The value to be damped
out_angular_velocity (Vector) – The speed of the value to be damped in deg/s
out_intermediate_rotation (Rotator) – The intermediate state of the double spring
out_intermediate_angular_velocity (Vector) – The intermediate velocity of the double spring
target_rotation (Rotator) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutRotation to TargetRotation
- Returns:
out_rotation (Rotator): The value to be damped
out_angular_velocity (Vector): The speed of the value to be damped in deg/s
out_intermediate_rotation (Rotator): The intermediate state of the double spring
out_intermediate_angular_velocity (Vector): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_double_spring_damp_scale(out_scale, out_scalar_velocity, out_intermediate_scale, out_intermediate_scalar_velocity, target_scale, delta_time, smoothing_time=0.200000) -> (out_scale=Vector, out_scalar_velocity=Vector, out_intermediate_scale=Vector, out_intermediate_scalar_velocity=Vector)¶
Interpolates the value InOutScale towards TargetScale using a critically damped spring via an intermediate state - producing a more S-shaped curve.
- Parameters:
out_scale (Vector) – The value to be damped
out_scalar_velocity (Vector) – The speed of the value to be damped
out_intermediate_scale (Vector) – The intermediate state of the double spring
out_intermediate_scalar_velocity (Vector) – The intermediate velocity of the double spring
target_scale (Vector) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutScale to TargetScale
- Returns:
out_scale (Vector): The value to be damped
out_scalar_velocity (Vector): The speed of the value to be damped
out_intermediate_scale (Vector): The intermediate state of the double spring
out_intermediate_scalar_velocity (Vector): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_double_spring_damp_transform(out_transform, out_velocity, out_intermediate_transform, out_intermediate_transform_velocity, target_transform, delta_time, smoothing_time=0.200000) -> (out_transform=Transform, out_velocity=SpringTransformVelocity, out_intermediate_transform=Transform, out_intermediate_transform_velocity=SpringTransformVelocity)¶
Interpolates the value InOutTransform towards TargetTransform using a critically damped spring via an intermediate state - producing a more S-shaped curve.
- Parameters:
out_transform (Transform) – The value to be damped
out_velocity (SpringTransformVelocity) – The speed of the value to be damped
out_intermediate_transform (Transform) – The intermediate state of the double spring
out_intermediate_transform_velocity (SpringTransformVelocity)
target_transform (Transform) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutTransform to TargetTransform
- Returns:
out_transform (Transform): The value to be damped
out_velocity (SpringTransformVelocity): The speed of the value to be damped
out_intermediate_transform (Transform): The intermediate state of the double spring
out_intermediate_transform_velocity (SpringTransformVelocity):
- Return type:
tuple
- classmethod critical_double_spring_damp_vector(out_x, out_v, out_xi, out_vi, target_x, delta_time, smoothing_time=0.200000) -> (out_x=Vector, out_v=Vector, out_xi=Vector, out_vi=Vector)¶
Interpolates the value InOutX towards TargetX using a critically damped spring via an intermediate state - producing a more S-shaped curve. The velocity of X is stored in InOutV.
- Parameters:
out_x (Vector) – The value to be damped
out_v (Vector) – The speed of the value to be damped
out_xi (Vector) – The intermediate state of the double spring
out_vi (Vector) – The intermediate velocity of the double spring
target_x (Vector) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX
- Returns:
out_x (Vector): The value to be damped
out_v (Vector): The speed of the value to be damped
out_xi (Vector): The intermediate state of the double spring
out_vi (Vector): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_double_spring_damp_vector2d(out_x, out_v, out_xi, out_vi, target_x, delta_time, smoothing_time=0.200000) -> (out_x=Vector2D, out_v=Vector2D, out_xi=Vector2D, out_vi=Vector2D)¶
Interpolates the value InOutX towards TargetX using a critically damped spring via an intermediate state - producing a more S-shaped curve. The velocity of X is stored in InOutV.
- Parameters:
out_x (Vector2D) – The value to be damped
out_v (Vector2D) – The speed of the value to be damped
out_xi (Vector2D) – The intermediate state of the double spring
out_vi (Vector2D) – The intermediate velocity of the double spring
target_x (Vector2D) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX
- Returns:
out_x (Vector2D): The value to be damped
out_v (Vector2D): The speed of the value to be damped
out_xi (Vector2D): The intermediate state of the double spring
out_vi (Vector2D): The intermediate velocity of the double spring
- Return type:
tuple
- classmethod critical_spring_damp_angle(out_angle, out_angular_velocity, target_angle, delta_time, smoothing_time=0.200000) -> (out_angle=float, out_angular_velocity=float)¶
Interpolates the angle InOutAngle towards TargetAngle with the motion of a critically damped spring. The velocity of InOutAngle is stored in InOutAngularVelocity in deg/s.
- Parameters:
out_angle (float) – The value to be damped in degrees
out_angular_velocity (float) – The speed of the value to be damped in deg/s
target_angle (float) – The goal to damp towards in degrees
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutAngle to TargetAngle
- Returns:
out_angle (float): The value to be damped in degrees
out_angular_velocity (float): The speed of the value to be damped in deg/s
- Return type:
tuple
- classmethod critical_spring_damp_float(out_x, out_v, target_x, delta_time, smoothing_time=0.200000) -> (out_x=float, out_v=float)¶
Interpolates the value InOutX towards TargetX with the motion of a critically damped spring. The velocity of X is stored in InOutV.
- Parameters:
out_x (float) – The value to be damped
out_v (float) – The speed of the value to be damped
target_x (float) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX
- Returns:
out_x (float): The value to be damped
out_v (float): The speed of the value to be damped
- Return type:
tuple
- classmethod critical_spring_damp_quat(out_rotation, out_angular_velocity, target_rotation, delta_time, smoothing_time=0.200000) -> (out_rotation=Quat, out_angular_velocity=Vector)¶
Interpolates the value InOutRotation towards TargetRotation with the motion of a critically damped spring. The velocity of InOutRotation is stored in InOutAngularVelocity in deg/s.
- Parameters:
out_rotation (Quat) – The value to be damped
out_angular_velocity (Vector) – The speed of the value to be damped in deg/s
target_rotation (Quat) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutRotation to TargetRotation
- Returns:
out_rotation (Quat): The value to be damped
out_angular_velocity (Vector): The speed of the value to be damped in deg/s
- Return type:
tuple
- classmethod critical_spring_damp_rotator(out_rotation, out_angular_velocity, target_rotation, delta_time, smoothing_time=0.200000) -> (out_rotation=Rotator, out_angular_velocity=Vector)¶
Interpolates the value InOutRotation towards TargetRotation with the motion of a critically damped spring. The velocity of InOutRotation is stored in InOutAngularVelocity in deg/s.
- Parameters:
out_rotation (Rotator) – The value to be damped
out_angular_velocity (Vector) – The speed of the value to be damped in deg/s
target_rotation (Rotator) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutRotation to TargetRotation
- Returns:
out_rotation (Rotator): The value to be damped
out_angular_velocity (Vector): The speed of the value to be damped in deg/s
- Return type:
tuple
- classmethod critical_spring_damp_scale(out_scale, out_scalar_velocity, target_scale, delta_time, smoothing_time=0.200000) -> (out_scale=Vector, out_scalar_velocity=Vector)¶
Interpolates the value InOutScale towards TargetScale with the motion of a critically damped spring.
- Parameters:
out_scale (Vector) – The value to be damped
out_scalar_velocity (Vector) – The speed of the value to be damped
target_scale (Vector) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutScale to TargetScale
- Returns:
out_scale (Vector): The value to be damped
out_scalar_velocity (Vector): The speed of the value to be damped
- Return type:
tuple
- classmethod critical_spring_damp_transform(out_transform, out_velocity, target_transform, delta_time, smoothing_time=0.200000) -> (out_transform=Transform, out_velocity=SpringTransformVelocity)¶
Interpolates the value InOutTransform towards TargetTransform with the motion of a critically damped spring.
- Parameters:
out_transform (Transform) – The value to be damped
out_velocity (SpringTransformVelocity) – The speed of the value to be damped
target_transform (Transform) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutTransform to TargetTransform
- Returns:
out_transform (Transform): The value to be damped
out_velocity (SpringTransformVelocity): The speed of the value to be damped
- Return type:
tuple
- classmethod critical_spring_damp_vector(out_x, out_v, target_x, delta_time, smoothing_time=0.200000) -> (out_x=Vector, out_v=Vector)¶
Interpolates the value InOutX towards TargetX with the motion of a critically damped spring. The velocity of X is stored in InOutV.
- Parameters:
out_x (Vector) – The value to be damped
out_v (Vector) – The speed of the value to be damped
target_x (Vector) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX
- Returns:
out_x (Vector): The value to be damped
out_v (Vector): The speed of the value to be damped
- Return type:
tuple
- classmethod critical_spring_damp_vector2d(out_x, out_v, target_x, delta_time, smoothing_time=0.200000) -> (out_x=Vector2D, out_v=Vector2D)¶
Interpolates the value InOutX towards TargetX with the motion of a critically damped spring. The velocity of X is stored in InOutV.
- Parameters:
out_x (Vector2D) – The value to be damped
out_v (Vector2D) – The speed of the value to be damped
target_x (Vector2D) – The goal to damp towards
delta_time (float) – Timestep in seconds
smoothing_time (float) – The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX
- Returns:
out_x (Vector2D): The value to be damped
out_v (Vector2D): The speed of the value to be damped
- Return type:
tuple
- classmethod cubic_inertialize_apply_to_angle(angle, angle_offset, angular_velocity_offset, time_since_transition, blend_time=0.200000) float¶
Applies a cubic inertialization to an angle, applying the appropriate offset given the time since transition.
- Parameters:
angle (float) – The angle to apply the inertialization to
angle_offset (float) – Offset angle at the time of transition
angular_velocity_offset (float) – Offset angular velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The angle with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_float(value, value_offset, velocity_offset, time_since_transition, blend_time=0.200000) float¶
Applies a cubic inertialization to a float value, adding the appropriate offset given the time since transition.
- Parameters:
value (float) – The value to apply the inertialization to
value_offset (float) – Offset value at the time of transition
velocity_offset (float) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The value with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_quat(rotation, rotation_offset, angular_velocity_offset, time_since_transition, blend_time=0.200000) Quat¶
Applies a cubic inertialization to a quaternion, applying the appropriate offset given the time since transition.
- Parameters:
rotation (Quat) – The rotation to apply the inertialization to
rotation_offset (Quat) – Offset rotation at the time of transition
angular_velocity_offset (Vector) – Offset angular velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The rotation with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_rotator(rotation, rotation_offset, angular_velocity_offset, time_since_transition, blend_time=0.200000) Rotator¶
Applies a cubic inertialization to a rotator, applying the appropriate offset given the time since transition.
- Parameters:
rotation (Rotator) – The rotation to apply the inertialization to
rotation_offset (Rotator) – Offset rotation at the time of transition
angular_velocity_offset (Vector) – Offset angular velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The rotation with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_scale(scale, scale_offset, scalar_velocity_offset, time_since_transition, blend_time=0.200000) Vector¶
Applies a cubic inertialization to a scale, applying the appropriate offset given the time since transition.
- Parameters:
scale (Vector) – The scale to apply the inertialization to
scale_offset (Vector) – Offset scale at the time of transition
scalar_velocity_offset (Vector) – Offset scalar velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The scale with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_transform(transform, transform_offset, velocity_offset, time_since_transition, blend_time=0.200000) Transform¶
Applies a cubic inertialization to a transform, applying the appropriate offset given the time since transition.
- Parameters:
transform (Transform) – The transform to apply the inertialization to
transform_offset (Transform) – Offset transform at the time of transition
velocity_offset (SpringTransformVelocity) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The transform with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_vector(value, value_offset, velocity_offset, time_since_transition, blend_time=0.200000) Vector¶
Applies a cubic inertialization to a vector value, adding the appropriate offset given the time since transition.
- Parameters:
value (Vector) – The value to apply the inertialization to
value_offset (Vector) – Offset value at the time of transition
velocity_offset (Vector) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The value with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_apply_to_vector2d(value, value_offset, velocity_offset, time_since_transition, blend_time=0.200000) Vector2D¶
Applies a cubic inertialization to a Vector2D value, adding the appropriate offset given the time since transition.
- Parameters:
value (Vector2D) – The value to apply the inertialization to
value_offset (Vector2D) – Offset value at the time of transition
velocity_offset (Vector2D) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The value with appropriate offset applied
- Return type:
- classmethod cubic_inertialize_transition_angle(out_angle_offset, out_angular_velocity_offset, src_angle, src_angular_velocity, dst_angle, dst_angular_velocity, time_since_transition, blend_time=0.200000) -> (out_angle_offset=float, out_angular_velocity_offset=float)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_angle_offset (float) – Offset angle to update
out_angular_velocity_offset (float) – Offset angular velocity to update
src_angle (float) – Angle of the source (angle transitioning from)
src_angular_velocity (float) – Angular velocity of the source (angular velocity transitioning from)
dst_angle (float) – Angle of the destination (angle transitioning to)
dst_angular_velocity (float) – Angular velocity of the destination (angular velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_angle_offset (float): Offset angle to update
out_angular_velocity_offset (float): Offset angular velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_float(out_value_offset, out_velocity_offset, src_value, src_velocity, dst_value, dst_velocity, time_since_transition, blend_time=0.200000) -> (out_value_offset=float, out_velocity_offset=float)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_value_offset (float) – Offset value to update
out_velocity_offset (float) – Offset velocity to update
src_value (float) – Value of the source (value transitioning from)
src_velocity (float) – Velocity of the source (velocity transitioning from)
dst_value (float) – Value of the destination (value transitioning to)
dst_velocity (float) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_value_offset (float): Offset value to update
out_velocity_offset (float): Offset velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_quat(out_rotation_offset, out_angular_velocity_offset, src_rotation, src_angular_velocity, dst_rotation, dst_angular_velocity, time_since_transition, blend_time=0.200000) -> (out_rotation_offset=Quat, out_angular_velocity_offset=Vector)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_rotation_offset (Quat) – Offset rotation to update
out_angular_velocity_offset (Vector) – Offset angular velocity to update
src_rotation (Quat) – Rotation of the source (rotation transitioning from)
src_angular_velocity (Vector) – Angular velocity of the source (angular velocity transitioning from)
dst_rotation (Quat) – Rotation of the destination (rotation transitioning to)
dst_angular_velocity (Vector) – Angular velocity of the destination (angular velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_rotation_offset (Quat): Offset rotation to update
out_angular_velocity_offset (Vector): Offset angular velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_rotator(out_rotation_offset, out_angular_velocity_offset, src_rotation, src_angular_velocity, dst_rotation, dst_angular_velocity, time_since_transition, blend_time=0.200000) -> (out_rotation_offset=Rotator, out_angular_velocity_offset=Vector)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_rotation_offset (Rotator) – Offset rotation to update
out_angular_velocity_offset (Vector) – Offset angular velocity to update
src_rotation (Rotator) – Rotation of the source (rotation transitioning from)
src_angular_velocity (Vector) – Angular velocity of the source (angular velocity transitioning from)
dst_rotation (Rotator) – Rotation of the destination (rotation transitioning to)
dst_angular_velocity (Vector) – Angular velocity of the destination (angular velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_rotation_offset (Rotator): Offset rotation to update
out_angular_velocity_offset (Vector): Offset angular velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_scale(out_scale_offset, out_scalar_velocity_offset, src_scale, src_scalar_velocity, dst_scale, dst_scalar_velocity, time_since_transition, blend_time=0.200000) -> (out_scale_offset=Vector, out_scalar_velocity_offset=Vector)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_scale_offset (Vector) – Offset scale to update
out_scalar_velocity_offset (Vector) – Offset scalar velocity to update
src_scale (Vector) – Scale of the source (scale transitioning from)
src_scalar_velocity (Vector) – Scalar velocity of the source (scalar velocity transitioning from)
dst_scale (Vector) – Scale of the destination (scale transitioning to)
dst_scalar_velocity (Vector) – Scalar velocity of the destination (scalar velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_scale_offset (Vector): Offset scale to update
out_scalar_velocity_offset (Vector): Offset scalar velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_transform(out_transform_offset, out_velocity_offset, src_transform, src_velocity, dst_transform, dst_velocity, time_since_transition, blend_time=0.200000) -> (out_transform_offset=Transform, out_velocity_offset=SpringTransformVelocity)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_transform_offset (Transform) – Offset transform to update
out_velocity_offset (SpringTransformVelocity) – Offset velocity to update
src_transform (Transform) – Transform of the source (transform transitioning from)
src_velocity (SpringTransformVelocity) – Velocity of the source (velocity transitioning from)
dst_transform (Transform) – Transform of the destination (transform transitioning to)
dst_velocity (SpringTransformVelocity) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_transform_offset (Transform): Offset transform to update
out_velocity_offset (SpringTransformVelocity): Offset velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_vector(out_value_offset, out_velocity_offset, src_value, src_velocity, dst_value, dst_velocity, time_since_transition, blend_time=0.200000) -> (out_value_offset=Vector, out_velocity_offset=Vector)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_value_offset (Vector) – Offset value to update
out_velocity_offset (Vector) – Offset velocity to update
src_value (Vector) – Value of the source (value transitioning from)
src_velocity (Vector) – Velocity of the source (velocity transitioning from)
dst_value (Vector) – Value of the destination (value transitioning to)
dst_velocity (Vector) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_value_offset (Vector): Offset value to update
out_velocity_offset (Vector): Offset velocity to update
- Return type:
tuple
- classmethod cubic_inertialize_transition_vector2d(out_value_offset, out_velocity_offset, src_value, src_velocity, dst_value, dst_velocity, time_since_transition, blend_time=0.200000) -> (out_value_offset=Vector2D, out_velocity_offset=Vector2D)¶
Transitions a cubic inertialization, updating the appropriate offsets.
- Parameters:
out_value_offset (Vector2D) – Offset value to update
out_velocity_offset (Vector2D) – Offset velocity to update
src_value (Vector2D) – Value of the source (value transitioning from)
src_velocity (Vector2D) – Velocity of the source (velocity transitioning from)
dst_value (Vector2D) – Value of the destination (value transitioning to)
dst_velocity (Vector2D) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_value_offset (Vector2D): Offset value to update
out_velocity_offset (Vector2D): Offset velocity to update
- Return type:
tuple
- classmethod damp_angle(angle, target_angle, delta_time, smoothing_time=0.200000) float¶
Smooths an angle in degrees using exponential damping towards a target.
- classmethod damp_float(value, target, delta_time, smoothing_time=0.200000) float¶
Smooths a value using exponential damping towards a target.
- classmethod damp_quat(rotation, target_rotation, delta_time, smoothing_time=0.200000) Quat¶
Smooths a rotation using exponential damping towards a target.
- classmethod damp_rotator(rotation, target_rotation, delta_time, smoothing_time=0.200000) Rotator¶
Smooths a value using exponential damping towards a target.
- classmethod damp_scale(scale, target_scale, delta_time, smoothing_time=0.200000) Vector¶
Smooths a scale using exponential damping towards a target.
- classmethod damp_transform(transform, target_transform, delta_time, smoothing_time=0.200000) Transform¶
Smooths a transform using exponential damping towards a target.
- Parameters:
- Return type:
- classmethod damp_vector(value, target, delta_time, smoothing_time=0.200000) Vector¶
Smooths a value using exponential damping towards a target.
- classmethod damp_vector2d(value, target, delta_time, smoothing_time=0.200000) Vector2D¶
Smooths a value using exponential damping towards a target.
- classmethod dead_blend_apply_to_angle(angle, angle_transition, angular_velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) float¶
Applies a dead blend to an angle, blending it with an extrapolation of the angle and velocity at the point of the last transition.
- Parameters:
angle (float) – The angle to apply the dead blend to
angle_transition (float) – The angle at the time of the last transition
angular_velocity_transition (float) – The angular velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended angle
- Return type:
- classmethod dead_blend_apply_to_float(value, value_transition, velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) float¶
Applies a dead blend to a float value, blending it with an extrapolation of the value and velocity at the point of the last transition.
- Parameters:
value (float) – The value to apply the dead blend to
value_transition (float) – The value at the time of the last transition
velocity_transition (float) – The velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended value
- Return type:
- classmethod dead_blend_apply_to_quat(rotation, rotation_transition, angular_velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) Quat¶
Applies a dead blend to a quaternion, blending it with an extrapolation of the rotation and velocity at the point of the last transition.
- Parameters:
rotation (Quat) – The rotation to apply the dead blend to
rotation_transition (Quat) – The rotation at the time of the last transition
angular_velocity_transition (Vector) – The angular velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended rotation
- Return type:
- classmethod dead_blend_apply_to_rotator(rotation, rotation_transition, angular_velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) Rotator¶
Applies a dead blend to a rotator, blending it with an extrapolation of the rotation and velocity at the point of the last transition.
- Parameters:
rotation (Rotator) – The rotation to apply the dead blend to
rotation_transition (Rotator) – The rotation at the time of the last transition
angular_velocity_transition (Vector) – The angular velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended rotation
- Return type:
- classmethod dead_blend_apply_to_scale(scale, scale_transition, scalar_velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) Vector¶
Applies a dead blend to a scale, blending it with an extrapolation of the scale and velocity at the point of the last transition.
- Parameters:
scale (Vector) – The scale to apply the dead blend to
scale_transition (Vector) – The scale at the time of the last transition
scalar_velocity_transition (Vector) – The scalar velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended scale
- Return type:
- classmethod dead_blend_apply_to_transform(transform, transform_transition, velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) Transform¶
Applies a dead blend to a transform, blending it with an extrapolation of the transform and velocity at the point of the last transition.
- Parameters:
transform (Transform) – The transform to apply the dead blend to
transform_transition (Transform) – The transform at the time of the last transition
velocity_transition (SpringTransformVelocity) – The velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended transform
- Return type:
- classmethod dead_blend_apply_to_vector(value, value_transition, velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) Vector¶
Applies a dead blend to a vector value, blending it with an extrapolation of the value and velocity at the point of the last transition.
- Parameters:
value (Vector) – The value to apply the dead blend to
value_transition (Vector) – The value at the time of the last transition
velocity_transition (Vector) – The velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended value
- Return type:
- classmethod dead_blend_apply_to_vector2d(value, value_transition, velocity_transition, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) Vector2D¶
Applies a dead blend to a Vector2D value, blending it with an extrapolation of the value and velocity at the point of the last transition.
- Parameters:
value (Vector2D) – The value to apply the dead blend to
value_transition (Vector2D) – The value at the time of the last transition
velocity_transition (Vector2D) – The velocity at the time of the last transition
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
The blended value
- Return type:
- classmethod dead_blend_transition_angle(out_angle_transition, out_angular_velocity_transition, src_angle, src_angular_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_angle_transition=float, out_angular_velocity_transition=float)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_angle_transition (float) – Angle at the point of transition
out_angular_velocity_transition (float) – Angular velocity at the point of transition
src_angle (float) – Angle of the source (angle transitioning from)
src_angular_velocity (float) – Angular velocity of the source (angular velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_angle_transition (float): Angle at the point of transition
out_angular_velocity_transition (float): Angular velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_float(out_value_transition, out_velocity_transition, src_value, src_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_value_transition=float, out_velocity_transition=float)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_value_transition (float) – Value at the point of transition
out_velocity_transition (float) – Velocity at the point of transition
src_value (float) – Value of the source (value transitioning from)
src_velocity (float) – Velocity of the source (velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_value_transition (float): Value at the point of transition
out_velocity_transition (float): Velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_quat(out_rotation_transition, out_angular_velocity_transition, src_rotation, src_angular_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_rotation_transition=Quat, out_angular_velocity_transition=Vector)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_rotation_transition (Quat) – Rotation at the point of transition
out_angular_velocity_transition (Vector) – Angular velocity at the point of transition
src_rotation (Quat) – Rotation of the source (rotation transitioning from)
src_angular_velocity (Vector) – Angular velocity of the source (angular velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_rotation_transition (Quat): Rotation at the point of transition
out_angular_velocity_transition (Vector): Angular velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_rotator(out_rotation_transition, out_angular_velocity_transition, src_rotation, src_angular_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_rotation_transition=Rotator, out_angular_velocity_transition=Vector)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_rotation_transition (Rotator) – Rotation at the point of transition
out_angular_velocity_transition (Vector) – Angular velocity at the point of transition
src_rotation (Rotator) – Rotation of the source (rotation transitioning from)
src_angular_velocity (Vector) – Angular velocity of the source (angular velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_rotation_transition (Rotator): Rotation at the point of transition
out_angular_velocity_transition (Vector): Angular velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_scale(out_scale_transition, out_scalar_velocity_transition, src_scale, src_scalar_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_scale_transition=Vector, out_scalar_velocity_transition=Vector)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_scale_transition (Vector) – Scale at the point of transition
out_scalar_velocity_transition (Vector) – Scalar velocity at the point of transition
src_scale (Vector) – Scale of the source (scale transitioning from)
src_scalar_velocity (Vector) – Scalar velocity of the source (scalar velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_scale_transition (Vector): Scale at the point of transition
out_scalar_velocity_transition (Vector): Scalar velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_transform(out_transform_transition, out_velocity_transition, src_transform, src_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_transform_transition=Transform, out_velocity_transition=SpringTransformVelocity)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_transform_transition (Transform) – Transform at the point of transition
out_velocity_transition (SpringTransformVelocity) – Velocity at the point of transition
src_transform (Transform) – Transform of the source (transform transitioning from)
src_velocity (SpringTransformVelocity) – Velocity of the source (velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_transform_transition (Transform): Transform at the point of transition
out_velocity_transition (SpringTransformVelocity): Velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_vector(out_value_transition, out_velocity_transition, src_value, src_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_value_transition=Vector, out_velocity_transition=Vector)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_value_transition (Vector) – Value at the point of transition
out_velocity_transition (Vector) – Velocity at the point of transition
src_value (Vector) – Value of the source (value transitioning from)
src_velocity (Vector) – Velocity of the source (velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_value_transition (Vector): Value at the point of transition
out_velocity_transition (Vector): Velocity at the point of transition
- Return type:
tuple
- classmethod dead_blend_transition_vector2d(out_value_transition, out_velocity_transition, src_value, src_velocity, time_since_transition, blend_time=0.200000, smoothing_time=0.200000) -> (out_value_transition=Vector2D, out_velocity_transition=Vector2D)¶
Transitions a dead blend, computing the new value and velocity at the point of transition.
- Parameters:
out_value_transition (Vector2D) – Value at the point of transition
out_velocity_transition (Vector2D) – Velocity at the point of transition
src_value (Vector2D) – Value of the source (value transitioning from)
src_velocity (Vector2D) – Velocity of the source (velocity transitioning from)
time_since_transition (float) – Time since the last transition
blend_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
smoothing_time (float) – Decay rate of the extrapolated velocity. Smaller values make the velocity decay faster.
- Returns:
out_value_transition (Vector2D): Value at the point of transition
out_velocity_transition (Vector2D): Velocity at the point of transition
- Return type:
tuple
- classmethod spring_character_maximum_acceleration(initial_velocity, initial_acceleration, target_velocity, smoothing_time=0.200000) float¶
Estimates an approximate maximum acceleration from a smoothing time for a character using a simple damped spring.
- Parameters:
initial_velocity (float) – The initial velocity of the character
initial_acceleration (float) – The initial acceleration of the character
target_velocity (float) – The target velocity of the character
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
- Returns:
An estimation of the maximum acceleration
- Return type:
- classmethod spring_character_maximum_angular_velocity(initial_angle, initial_angular_velocity, target_angle, smoothing_time=0.200000) float¶
Estimates an approximate maximum angular velocity from a smoothing time for a character using a simple damped spring.
- Parameters:
initial_angle (float) – The initial angle of the character in degrees
initial_angular_velocity (float) – The initial angular velocity of the character in deg/s
target_angle (float) – The target angle of the character
smoothing_time (float) – The time over which to smooth angle. It takes roughly the smoothing time in order for the character to reach the target angle.
- Returns:
An estimation of the maximum angular velocity
- Return type:
- classmethod spring_character_smoothing_time_from_maximum_acceleration(initial_velocity, target_velocity, maximum_acceleration) float¶
Estimates an approximate smoothing time from a maximum acceleration for a character using by a simple damped spring.
- classmethod spring_character_smoothing_time_from_maximum_angular_velocity(initial_angle, target_angle, maximum_angular_velocity) float¶
Estimates an approximate smoothing time from a maximum angular velocity for a character using by a simple damped spring.
- classmethod spring_character_smoothing_time_from_starting_distance(target_velocity, starting_distance=100.000000, velocity_threshold=10.000000) float¶
Estimates an approximate smoothing time from a starting distance for a character using by a simple damped spring.
- Parameters:
- Returns:
An estimation of the SmoothingTime of the spring
- Return type:
- classmethod spring_character_smoothing_time_from_starting_time(target_velocity, starting_time=1.000000, velocity_threshold=10.000000) float¶
Estimates an approximate smoothing time from a starting time for a character using by a simple damped spring.
- Parameters:
- Returns:
An estimation of the SmoothingTime of the spring
- Return type:
- classmethod spring_character_smoothing_time_from_stopping_distance(initial_velocity, stopping_distance=100.000000) float¶
Estimates an approximate smoothing time from a stopping distance for a character using by a simple damped spring. Assumes the initial acceleration is zero.
- classmethod spring_character_smoothing_time_from_stopping_time(initial_velocity, stopping_time=1.000000, velocity_threshold=10.000000) float¶
Estimates an approximate smoothing time from a stopping time for a character using by a simple damped spring. Assumes the initial acceleration is zero.
- Parameters:
- Returns:
An estimation of the SmoothingTime of the spring
- Return type:
- classmethod spring_character_smoothing_time_from_turning_time(target_angle, turning_time=1.000000, angle_threshold=5.000000) float¶
Estimates an approximate smoothing time from a turning time for a character using by a simple damped spring.
- Parameters:
- Returns:
An estimation of the SmoothingTime of the spring
- Return type:
- classmethod spring_character_starting_distance(target_velocity, smoothing_time=0.200000, velocity_threshold=10.000000) float¶
Estimates an approximate starting distance (distance traveled until the velocity is within the VelocityThreshold of the target) from a smoothing time for a character using a simple damped spring
- Parameters:
target_velocity (float) – The target velocity of the character
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
velocity_threshold (float) – The velocity threshold from the target at which the character is considered to have started in cm/s
- Returns:
An estimation of the total distance traveled during the start
- Return type:
- classmethod spring_character_starting_time(target_velocity, smoothing_time=0.200000, velocity_threshold=10.000000) float¶
Estimates an approximate starting time (time until the velocity is within the VelocityThreshold of the target) from a smoothing time for a character using a simple damped spring.
- Parameters:
target_velocity (float) – The target velocity of the character
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
velocity_threshold (float) – The velocity threshold from the target at which the character is considered to have started in cm/s
- Returns:
An estimation of the time taken to come to a start
- Return type:
- classmethod spring_character_stopping_distance(initial_velocity, initial_acceleration, smoothing_time=0.200000) float¶
Estimates an approximate stopping distance from a smoothing time for a character using a simple damped spring
- Parameters:
initial_velocity (float) – The velocity of the character at the start of the stop
initial_acceleration (float) – The acceleration of the character at the start of the stop
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
- Returns:
An estimation of the total distance traveled during the stop
- Return type:
- classmethod spring_character_stopping_time(initial_velocity, smoothing_time=0.200000, velocity_threshold=1.000000) float¶
Estimates an approximate stopping time (how long until the velocity goes below the VelocityThreshold) from a smoothing time for a character using a simple damped spring. Assumes the initial acceleration is zero.
- Parameters:
initial_velocity (float) – The velocity of the character at the start of the stop
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
velocity_threshold (float) – The velocity threshold at which the character is considered to be stopped in cm/s
- Returns:
An estimation of the time taken to come to a stop
- Return type:
- classmethod spring_character_turning_time(target_angle, smoothing_time=0.200000, angle_threshold=5.000000) float¶
Estimates an approximate turning time (time until the angle is within the AngleThreshold of the target) from a smoothing time for a character using a simple damped spring. Assumes the initial angular velocity is zero.
- Parameters:
target_angle (float) – The target angle of the character in degrees
smoothing_time (float) – The time over which to smooth turning. It takes roughly the smoothing time in order for the character to reach the target angle.
angle_threshold (float) – The angle threshold from the target at which the character is considered to have turned in degrees
- Returns:
An estimation of the time taken to turn
- Return type:
- classmethod spring_character_update(out_position, out_velocity, out_acceleration, target_velocity, delta_time, smoothing_time=0.200000) -> (out_position=Vector, out_velocity=Vector, out_acceleration=Vector)¶
Update the position of a character given a target velocity using a simple damped spring
- Parameters:
out_position (Vector) – The position of the character
out_velocity (Vector) – The velocity of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
out_acceleration (Vector) – The acceleration of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
target_velocity (Vector) – The target velocity of the character.
delta_time (float) – The delta time to tick the character
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
- Returns:
out_position (Vector): The position of the character
out_velocity (Vector): The velocity of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
out_acceleration (Vector): The acceleration of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
- Return type:
tuple
- classmethod spring_inertialize_apply_to_angle(angle, angle_offset, angular_velocity_offset, time_since_transition, smoothing_time=0.200000) float¶
Applies a spring inertialization to a angle, adding the appropriate offset given the time since transition.
- Parameters:
angle (float) – The angle to apply the inertialization to
angle_offset (float) – Offset angle at the time of transition
angular_velocity_offset (float) – Offset angular velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The angle with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_float(value, value_offset, velocity_offset, time_since_transition, smoothing_time=0.200000) float¶
Applies a spring inertialization to a float value, adding the appropriate offset given the time since transition.
- Parameters:
value (float) – The value to apply the inertialization to
value_offset (float) – Offset value at the time of transition
velocity_offset (float) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The value with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_quat(rotation, rotation_offset, angular_velocity_offset, time_since_transition, smoothing_time=0.200000) Quat¶
Applies a spring inertialization to a quaternion, applying the appropriate offset given the time since transition.
- Parameters:
rotation (Quat) – The rotation to apply the inertialization to
rotation_offset (Quat) – Offset rotation at the time of transition
angular_velocity_offset (Vector) – Offset angular velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The rotation with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_rotator(rotation, rotation_offset, angular_velocity_offset, time_since_transition, smoothing_time=0.200000) Rotator¶
Applies a spring inertialization to a rotator, applying the appropriate offset given the time since transition.
- Parameters:
rotation (Rotator) – The rotation to apply the inertialization to
rotation_offset (Rotator) – Offset rotation at the time of transition
angular_velocity_offset (Vector) – Offset angular velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The rotation with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_scale(scale, scale_offset, scalar_velocity_offset, time_since_transition, smoothing_time=0.200000) Vector¶
Applies a spring inertialization to a scale, applying the appropriate offset given the time since transition.
- Parameters:
scale (Vector) – The scale to apply the inertialization to
scale_offset (Vector) – Offset scale at the time of transition
scalar_velocity_offset (Vector) – Offset scalar velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The scale with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_transform(transform, transform_offset, velocity_offset, time_since_transition, smoothing_time=0.200000) Transform¶
Applies a spring inertialization to a transform, applying the appropriate offset given the time since transition.
- Parameters:
transform (Transform) – The transform to apply the inertialization to
transform_offset (Transform) – Offset transform at the time of transition
velocity_offset (SpringTransformVelocity) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The transform with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_vector(value, value_offset, velocity_offset, time_since_transition, smoothing_time=0.200000) Vector¶
Applies a spring inertialization to a vector value, adding the appropriate offset given the time since transition.
- Parameters:
value (Vector) – The value to apply the inertialization to
value_offset (Vector) – Offset value at the time of transition
velocity_offset (Vector) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The value with appropriate offset applied
- Return type:
- classmethod spring_inertialize_apply_to_vector2d(value, value_offset, velocity_offset, time_since_transition, smoothing_time=0.200000) Vector2D¶
Applies a spring inertialization to a Vector2D value, adding the appropriate offset given the time since transition.
- Parameters:
value (Vector2D) – The value to apply the inertialization to
value_offset (Vector2D) – Offset value at the time of transition
velocity_offset (Vector2D) – Offset velocity at the time of transition
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
The value with appropriate offset applied
- Return type:
- classmethod spring_inertialize_transition_angle(out_angle_offset, out_angular_velocity_offset, src_angle, src_angular_velocity, dst_angle, dst_angular_velocity, time_since_transition, smoothing_time=0.200000) -> (out_angle_offset=float, out_angular_velocity_offset=float)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_angle_offset (float) – Offset angle to update
out_angular_velocity_offset (float) – Offset angular velocity to update
src_angle (float) – Angle of the source (angle transitioning from)
src_angular_velocity (float) – Angular velocity of the source (angular velocity transitioning from)
dst_angle (float) – Angle of the destination (angle transitioning to)
dst_angular_velocity (float) – Angular velocity of the destination (angular velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_angle_offset (float): Offset angle to update
out_angular_velocity_offset (float): Offset angular velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_float(out_value_offset, out_velocity_offset, src_value, src_velocity, dst_value, dst_velocity, time_since_transition, smoothing_time=0.200000) -> (out_value_offset=float, out_velocity_offset=float)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_value_offset (float) – Offset value to update
out_velocity_offset (float) – Offset velocity to update
src_value (float) – Value of the source (value transitioning from)
src_velocity (float) – Velocity of the source (velocity transitioning from)
dst_value (float) – Value of the destination (value transitioning to)
dst_velocity (float) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_value_offset (float): Offset value to update
out_velocity_offset (float): Offset velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_quat(out_rotation_offset, out_angular_velocity_offset, src_rotation, src_angular_velocity, dst_rotation, dst_angular_velocity, time_since_transition, smoothing_time=0.200000) -> (out_rotation_offset=Quat, out_angular_velocity_offset=Vector)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_rotation_offset (Quat) – Offset rotation to update
out_angular_velocity_offset (Vector) – Offset angular velocity to update
src_rotation (Quat) – Rotation of the source (rotation transitioning from)
src_angular_velocity (Vector) – Angular velocity of the source (angular velocity transitioning from)
dst_rotation (Quat) – Rotation of the destination (rotation transitioning to)
dst_angular_velocity (Vector) – Angular velocity of the destination (angular velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_rotation_offset (Quat): Offset rotation to update
out_angular_velocity_offset (Vector): Offset angular velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_rotator(out_rotation_offset, out_angular_velocity_offset, src_rotation, src_angular_velocity, dst_rotation, dst_angular_velocity, time_since_transition, smoothing_time=0.200000) -> (out_rotation_offset=Rotator, out_angular_velocity_offset=Vector)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_rotation_offset (Rotator) – Offset rotation to update
out_angular_velocity_offset (Vector) – Offset angular velocity to update
src_rotation (Rotator) – Rotation of the source (rotation transitioning from)
src_angular_velocity (Vector) – Angular velocity of the source (angular velocity transitioning from)
dst_rotation (Rotator) – Rotation of the destination (rotation transitioning to)
dst_angular_velocity (Vector) – Angular velocity of the destination (angular velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_rotation_offset (Rotator): Offset rotation to update
out_angular_velocity_offset (Vector): Offset angular velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_scale(out_scale_offset, out_scalar_velocity_offset, src_scale, src_scalar_velocity, dst_scale, dst_scalar_velocity, time_since_transition, smoothing_time=0.200000) -> (out_scale_offset=Vector, out_scalar_velocity_offset=Vector)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_scale_offset (Vector) – Offset scale to update
out_scalar_velocity_offset (Vector) – Offset scalar velocity to update
src_scale (Vector) – Scale of the source (scale transitioning from)
src_scalar_velocity (Vector) – Scalar velocity of the source (scalar velocity transitioning from)
dst_scale (Vector) – Scale of the destination (scale transitioning to)
dst_scalar_velocity (Vector) – Scalar velocity of the destination (scalar velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_scale_offset (Vector): Offset scale to update
out_scalar_velocity_offset (Vector): Offset scalar velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_transform(out_transform_offset, out_velocity_offset, src_transform, src_velocity, dst_transform, dst_velocity, time_since_transition, smoothing_time=0.200000) -> (out_transform_offset=Transform, out_velocity_offset=SpringTransformVelocity)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_transform_offset (Transform) – Offset transform to update
out_velocity_offset (SpringTransformVelocity) – Offset velocity to update
src_transform (Transform) – Transform of the source (transform transitioning from)
src_velocity (SpringTransformVelocity) – Velocity of the source (velocity transitioning from)
dst_transform (Transform) – Transform of the destination (transform transitioning to)
dst_velocity (SpringTransformVelocity) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_transform_offset (Transform): Offset transform to update
out_velocity_offset (SpringTransformVelocity): Offset velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_vector(out_value_offset, out_velocity_offset, src_value, src_velocity, dst_value, dst_velocity, time_since_transition, smoothing_time=0.200000) -> (out_value_offset=Vector, out_velocity_offset=Vector)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_value_offset (Vector) – Offset value to update
out_velocity_offset (Vector) – Offset velocity to update
src_value (Vector) – Value of the source (value transitioning from)
src_velocity (Vector) – Velocity of the source (velocity transitioning from)
dst_value (Vector) – Value of the destination (value transitioning to)
dst_velocity (Vector) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_value_offset (Vector): Offset value to update
out_velocity_offset (Vector): Offset velocity to update
- Return type:
tuple
- classmethod spring_inertialize_transition_vector2d(out_value_offset, out_velocity_offset, src_value, src_velocity, dst_value, dst_velocity, time_since_transition, smoothing_time=0.200000) -> (out_value_offset=Vector2D, out_velocity_offset=Vector2D)¶
Transitions a spring inertialization, updating the appropriate offsets.
- Parameters:
out_value_offset (Vector2D) – Offset value to update
out_velocity_offset (Vector2D) – Offset velocity to update
src_value (Vector2D) – Value of the source (value transitioning from)
src_velocity (Vector2D) – Velocity of the source (velocity transitioning from)
dst_value (Vector2D) – Value of the destination (value transitioning to)
dst_velocity (Vector2D) – Velocity of the destination (velocity transitioning to)
time_since_transition (float) – Time since the last transition
smoothing_time (float) – Timescale over which to apply the offset. Larger values result in longer blend times. Can be zero.
- Returns:
out_value_offset (Vector2D): Offset value to update
out_velocity_offset (Vector2D): Offset velocity to update
- Return type:
tuple
- classmethod track_velocity_angle(out_value, out_velocity, value, delta_time) -> (out_value=float, out_velocity=float)¶
Update the value and velocity using the finite difference
- classmethod track_velocity_float(out_value, out_velocity, value, delta_time) -> (out_value=float, out_velocity=float)¶
Update the value and velocity using the finite difference
- classmethod track_velocity_quat(out_value, out_velocity, value, delta_time) -> (out_value=Quat, out_velocity=Vector)¶
Update the value and velocity using the finite difference
- classmethod track_velocity_rotator(out_value, out_velocity, value, delta_time) -> (out_value=Rotator, out_velocity=Vector)¶
Update the value and velocity using the finite difference
- classmethod track_velocity_scale(out_value, out_velocity, value, delta_time) -> (out_value=Vector, out_velocity=Vector)¶
Update the value and velocity using the finite difference
- classmethod track_velocity_transform(out_value, out_velocity, value, delta_time) -> (out_value=Transform, out_velocity=SpringTransformVelocity)¶
Update the value and velocity using the finite difference
- Parameters:
out_value (Transform)
out_velocity (SpringTransformVelocity)
value (Transform)
delta_time (float)
- Returns:
out_value (Transform):
out_velocity (SpringTransformVelocity):
- Return type:
tuple
- classmethod track_velocity_vector(out_value, out_velocity, value, delta_time) -> (out_value=Vector, out_velocity=Vector)¶
Update the value and velocity using the finite difference
- classmethod track_velocity_vector2d(out_value, out_velocity, value, delta_time) -> (out_value=Vector2D, out_velocity=Vector2D)¶
Update the value and velocity using the finite difference
- classmethod velocity_spring_character_update(out_position, out_velocity, out_velocity_intermediate, out_acceleration, target_velocity, delta_time, smoothing_time=0.200000, max_acceleration=1.000000) -> (out_position=Vector, out_velocity=Vector, out_velocity_intermediate=Vector, out_acceleration=Vector)¶
Update a position representing a character given a target velocity using a velocity spring. A velocity spring tracks an intermediate velocity which moves at a maximum acceleration linearly towards a target. This means unlike the “SpringCharacterUpdate”, it will take longer to reach a target velocity that is further away from the current velocity.
- Parameters:
out_position (Vector) – The position of the character
out_velocity (Vector) – The velocity of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
out_velocity_intermediate (Vector) – The intermediate velocity of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
out_acceleration (Vector) – The acceleration of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
target_velocity (Vector) – The target velocity of the character.
delta_time (float) – The delta time to tick the character
smoothing_time (float) – The time over which to smooth velocity. It takes roughly the smoothing time in order for the character to reach the target velocity.
max_acceleration (float) – Puts a limit on the maximum acceleration that the intermediate velocity can do each frame. If MaxAccel is very large, the behaviour will be the same as SpringCharacterUpdate
- Returns:
out_position (Vector): The position of the character
out_velocity (Vector): The velocity of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
out_velocity_intermediate (Vector): The intermediate velocity of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
out_acceleration (Vector): The acceleration of the character. Needs to be stored and persisted by the caller. Usually initialized to zero and not modified by the caller.
- Return type:
tuple
- classmethod velocity_spring_damp_float(out_x, out_v, out_vi, target_x, max_speed, delta_time, smoothing_time=0.200000) -> (out_x=float, out_v=float, out_vi=float)¶
A velocity spring will damp towards a target that follows a fixed linear target velocity, allowing control of the interpolation speed while still giving a smoothed behavior. A SmoothingTime of 0 will give a linear interpolation between X and TargetX
- Parameters:
out_x (float) – The value to be damped
out_v (float) – The velocity of the value to be damped
out_vi (float) – The intermediate target velocity of the value to be damped
target_x (float) – The target value of X to damp towards
max_speed (float) – The desired speed to achieve while damping towards X
delta_time (float) – The timestep in seconds
smoothing_time (float) – The smoothing time to use while damping towards X. Higher values will give more smoothed behaviour. A value of 0 will give a linear interpolation of X to Target
- Returns:
out_x (float): The value to be damped
out_v (float): The velocity of the value to be damped
out_vi (float): The intermediate target velocity of the value to be damped
- Return type:
tuple
- classmethod velocity_spring_damp_vector(out_x, out_v, out_vi, target_x, max_speed, delta_time, smoothing_time=0.200000) -> (out_x=Vector, out_v=Vector, out_vi=Vector)¶
A velocity spring will damp towards a target that follows a fixed linear target velocity, allowing control of the interpolation speed while still giving a smoothed behavior. A SmoothingTime of 0 will give a linear interpolation between X and TargetX
- Parameters:
out_x (Vector) – The value to be damped
out_v (Vector) – The velocity of the value to be damped
out_vi (Vector) – The intermediate target velocity of the value to be damped
target_x (Vector) – The target value of X to damp towards
max_speed (float) – The desired speed to achieve while damping towards X
delta_time (float) – The timestep in seconds
smoothing_time (float) – The smoothing time to use while damping towards X. Higher values will give more smoothed behaviour. A value of 0 will give a linear interpolation of X to Target
- Returns:
out_x (Vector): The value to be damped
out_v (Vector): The velocity of the value to be damped
out_vi (Vector): The intermediate target velocity of the value to be damped
- Return type:
tuple
- classmethod velocity_spring_damp_vector2d(out_x, out_v, out_vi, target_x, max_speed, delta_time, smoothing_time=0.200000) -> (out_x=Vector2D, out_v=Vector2D, out_vi=Vector2D)¶
A velocity spring will damp towards a target that follows a fixed linear target velocity, allowing control of the interpolation speed while still giving a smoothed behavior. A SmoothingTime of 0 will give a linear interpolation between X and TargetX
- Parameters:
out_x (Vector2D) – The value to be damped
out_v (Vector2D) – The velocity of the value to be damped
out_vi (Vector2D) – The intermediate target velocity of the value to be damped
target_x (Vector2D) – The target value of X to damp towards
max_speed (float) – The desired speed to achieve while damping towards X
delta_time (float) – The timestep in seconds
smoothing_time (float) – The smoothing time to use while damping towards X. Higher values will give more smoothed behaviour. A value of 0 will give a linear interpolation of X to Target
- Returns:
out_x (Vector2D): The value to be damped
out_v (Vector2D): The velocity of the value to be damped
out_vi (Vector2D): The intermediate target velocity of the value to be damped
- Return type:
tuple