move: add move_towards_exp; deprecate move_towards_power

move_towards_exp is just a renamed move_towards_power with an initial
velocity argument, for consistency with other wrappers.
This commit is contained in:
Andrei Alexeyev 2023-02-15 23:03:33 +01:00
parent ac57f58de2
commit 7e93344511
No known key found for this signature in database
GPG key ID: 72D26128040B9690

View file

@ -75,14 +75,20 @@ INLINE MoveParams move_from_towards(cmplx origin, cmplx target, cmplx attraction
return move_next(origin, move_towards(0, target, attraction));
}
INLINE MoveParams move_towards_power(cmplx target, cmplx attraction, real exponent) {
INLINE MoveParams move_towards_exp(cmplx vel, cmplx target, cmplx attraction, real exponent) {
return (MoveParams) {
.velocity = vel,
.attraction = attraction,
.attraction_point = target,
.attraction_exponent = exponent
};
}
attr_deprecated("Use move_towards_exp instead")
INLINE MoveParams move_towards_power(cmplx target, cmplx attraction, real exponent) {
return move_towards_exp(0, target, attraction, exponent);
}
INLINE MoveParams move_dampen(cmplx vel, cmplx retention) {
return (MoveParams) {
.velocity = vel,