|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
A collection of motion and interpolation utilities.
Provides utilities for timer management, proportional smoothing and fixed step movement for both scalar and angular data types.
All functions operate directly on pointers to allow for in-place updates.
Functions | |
| template<typename T> | |
| T | calcTimer (T *value) |
| Decrements a timer value. | |
| float | addCalc (float *value, float target, float smoothing, float maxStep, float minStep) |
Smoothly moves value towards target using proportional scaling. | |
| template<typename T> | |
| T | addCalcAngleT (T *value, T target, T smoothing, T maxStep, T minStep) |
Smoothly moves value towards target using proportional scaling. | |
| s16 | addCalcAngle (s16 *value, s16 target, s16 smoothing, s16 maxStep, s16 minStep) |
Smoothly moves value towards target using proportional scaling. | |
| template<typename T> | |
| void | addCalcAngleT (T *value, T target, T smoothing, T maxStep) |
Smoothly moves value towards target using proportional scaling. | |
| void | addCalcAngle (s16 *value, s16 target, s16 smoothing, s16 maxStep) |
Smoothly moves value towards target using proportional scaling. | |
| template<typename T> | |
| BOOL | chaseT (T *value, T target, T step) |
Moves value towards target by a fixed step amount. | |
| BOOL | chase (s16 *value, s16 target, s16 step) |
Moves value towards target by a fixed step amount. | |
| BOOL | chase (int *value, int target, int step) |
Moves value towards target by a fixed step amount. | |
| BOOL | chase (long *value, long target, long step) |
Moves value towards target by a fixed step amount. | |
| BOOL | chase (float *value, float target, float step) |
Moves value towards target by a fixed step amount. | |
| BOOL | chaseAngle (s16 *value, s16 target, s16 step) |
Moves value towards target by a fixed step amount. | |
| BOOL | chaseAngleByRotDir (s16 *value, s16 target, s16 step) |
Moves value towards target by a fixed step amount. | |
| T sLib::calcTimer | ( | T * | value | ) |
| float sLib::addCalc | ( | float * | value, |
| float | target, | ||
| float | smoothing, | ||
| float | maxStep, | ||
| float | minStep ) |
Smoothly moves value towards target using proportional scaling.
If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| smoothing | The smoothing factor (between 0.0 and 1.0). Higher value means snappier movement. |
| maxStep | The maximum step for a single update. |
| minStep | The minimum step to prevent jittering. |
| T sLib::addCalcAngleT | ( | T * | value, |
| T | target, | ||
| T | smoothing, | ||
| T | maxStep, | ||
| T | minStep ) |
Smoothly moves value towards target using proportional scaling.
If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| smoothing | The smoothing factor. Higher value means smoother movement. |
| maxStep | The maximum step for a single update. |
| minStep | The minimum step to prevent jittering. |
| s16 sLib::addCalcAngle | ( | s16 * | value, |
| s16 | target, | ||
| s16 | smoothing, | ||
| s16 | maxStep, | ||
| s16 | minStep ) |
Smoothly moves value towards target using proportional scaling.
If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| smoothing | The smoothing factor. Higher value means smoother movement. |
| maxStep | The maximum step for a single update. |
| minStep | The minimum step to prevent jittering. |
| void sLib::addCalcAngleT | ( | T * | value, |
| T | target, | ||
| T | smoothing, | ||
| T | maxStep ) |
Smoothly moves value towards target using proportional scaling.
If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| smoothing | The smoothing factor. Higher value means smoother movement. |
| maxStep | The maximum step for a single update. |
| void sLib::addCalcAngle | ( | s16 * | value, |
| s16 | target, | ||
| s16 | smoothing, | ||
| s16 | maxStep ) |
Smoothly moves value towards target using proportional scaling.
If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| smoothing | The smoothing factor. Higher value means smoother movement. |
| maxStep | The maximum step for a single update. |
| BOOL sLib::chaseT | ( | T * | value, |
| T | target, | ||
| T | step ) |
Moves value towards target by a fixed step amount.
The step direction is automatically adjusted to move toward the target. If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise. | BOOL sLib::chase | ( | s16 * | value, |
| s16 | target, | ||
| s16 | step ) |
Moves value towards target by a fixed step amount.
The step direction is automatically adjusted to move toward the target. If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise. | BOOL sLib::chase | ( | int * | value, |
| int | target, | ||
| int | step ) |
Moves value towards target by a fixed step amount.
The step direction is automatically adjusted to move toward the target. If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise. | BOOL sLib::chase | ( | long * | value, |
| long | target, | ||
| long | step ) |
Moves value towards target by a fixed step amount.
The step direction is automatically adjusted to move toward the target. If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise. | BOOL sLib::chase | ( | float * | value, |
| float | target, | ||
| float | step ) |
Moves value towards target by a fixed step amount.
The step direction is automatically adjusted to move toward the target. If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise. | BOOL sLib::chaseAngle | ( | s16 * | value, |
| s16 | target, | ||
| s16 | step ) |
Moves value towards target by a fixed step amount.
The step direction is automatically adjusted to move toward the target. If the applied step overshoots the target, the value is snapped exactly to the target.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise. | BOOL sLib::chaseAngleByRotDir | ( | s16 * | value, |
| s16 | target, | ||
| s16 | step ) |
Moves value towards target by a fixed step amount.
The sign of step determines the rotation direction and is not automatically adjusted.
| value | The value to be updated. |
| target | The target value. |
| step | The step value. |
TRUE if the value reached the target, FALSE otherwise.