move: add move_next()
Computes the next state of a MoveParams given position, and returns it as new MoveParams.
This commit is contained in:
parent
7d57eb0937
commit
9502941631
1 changed files with 5 additions and 0 deletions
|
@ -23,6 +23,11 @@ typedef struct MoveParams {
|
|||
cmplx move_update(cmplx *restrict pos, MoveParams *restrict params);
|
||||
cmplx move_update_multiple(uint times, cmplx *restrict pos, MoveParams *restrict params);
|
||||
|
||||
INLINE MoveParams move_next(cmplx pos, MoveParams move) {
|
||||
move_update(&pos, &move);
|
||||
return move;
|
||||
}
|
||||
|
||||
INLINE MoveParams move_linear(cmplx vel) {
|
||||
return (MoveParams) { vel, 0, 1 };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue