slerp
Performs a spherical linear interpolation between
self
andend
based on the values
. This corresponds to interpolating between the two angles at a constant angular velocity. Whens == 0.0
, the result will be equal toself
. Whens == 1.0
, the result will be equal torhs
. If you would like the rotation to have a kind of ease-in-out effect, consider using the slightly more efficientnlerp
instead.Example
# use bevy_math::Rot2; # let rot1 = Rot2::IDENTITY; let rot2 = Rot2::degrees(135.0); let result1 = rot1.slerp(rot2, 1.0 / 3.0); assert_eq!(result1.as_degrees(), 45.0); let result2 = rot1.slerp(rot2, 0.5); assert_eq!(result2.as_degrees(), 67.5);
Arguments
- _self :
Rot2
- No Documentation 🚧 - end :
Rot2
- No Documentation 🚧 - s :
f32
- No Documentation 🚧
Returns
- arg0 :
Rot2
- No Documentation 🚧