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:
parent
ac57f58de2
commit
7e93344511
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue