Value that moves toward a target at a speed quadratic in the distance left.
More...
#include <quadraticapproach.h>
|
| | QuadraticApproach (const Vector3 &coeffs, float fValue, float fMaxSpeed) |
| | Construct a value at rest.
|
| | ~QuadraticApproach () |
| | Destroy the value.
|
| float | Step (float fDelta, float fTarget) |
| | Move the value toward a target without passing it.
|
| float | GetValue () const |
| void | SetCurve (const Vector3 &coeffs, float flMaxSpeed) |
| | Set the curve and the greatest speed.
|
Value that moves toward a target at a speed quadratic in the distance left.
The class is not polymorphic, and the name is inferred. The object is 0x14 bytes.
◆ QuadraticApproach()
| QuadraticApproach::QuadraticApproach |
( |
const Vector3 & | coeffs, |
|
|
float | fValue, |
|
|
float | fMaxSpeed ) |
Construct a value at rest.
- Parameters
-
| coeffs | The coefficients of the speed, the square term in x, the linear term in y, and the constant in z. |
| fValue | The value. |
| fMaxSpeed | The greatest speed. |
- Ghidra address:
- NTSC-U/C: 0x001e2bb0
- Ghidra address:
- PAL: 0x001eb950
◆ ~QuadraticApproach()
| QuadraticApproach::~QuadraticApproach |
( |
| ) |
|
Destroy the value.
- Ghidra address:
- NTSC-U/C: 0x001e2bd8
- Ghidra address:
- PAL: 0x001eb978
◆ Step()
| float QuadraticApproach::Step |
( |
float | fDelta, |
|
|
float | fTarget ) |
Move the value toward a target without passing it.
The speed is the quadratic of the distance to the target, limited to the greatest speed. A negative speed leaves the value where it is.
- Parameters
-
| fDelta | The time since the last step. |
| fTarget | The target. |
- Returns
- The speed, negative when the value moves down, or 0 when it does not move.
- Ghidra address:
- NTSC-U/C: 0x001e2c00
- Ghidra address:
- PAL: 0x001eb9a0
◆ GetValue()
| float QuadraticApproach::GetValue |
( |
| ) |
const |
|
inline |
◆ SetCurve()
| void QuadraticApproach::SetCurve |
( |
const Vector3 & | coeffs, |
|
|
float | flMaxSpeed ) |
|
inline |
Set the curve and the greatest speed.
- Parameters
-
| coeffs | The coefficients of the square of the distance, of the distance, and of no distance. |
| flMaxSpeed | The greatest speed. |
The documentation for this class was generated from the following file: