wavelength 1.0.0
Loading...
Searching...
No Matches
QuadraticApproach Class Reference

Value that moves toward a target at a speed quadratic in the distance left. More...

#include <quadraticapproach.h>

Public Member Functions

 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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ QuadraticApproach()

QuadraticApproach::QuadraticApproach ( const Vector3 & coeffs,
float fValue,
float fMaxSpeed )

Construct a value at rest.

Parameters
coeffsThe coefficients of the speed, the square term in x, the linear term in y, and the constant in z.
fValueThe value.
fMaxSpeedThe 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

Member Function Documentation

◆ 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
fDeltaThe time since the last step.
fTargetThe 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
Returns
The value.

◆ SetCurve()

void QuadraticApproach::SetCurve ( const Vector3 & coeffs,
float flMaxSpeed )
inline

Set the curve and the greatest speed.

Parameters
coeffsThe coefficients of the square of the distance, of the distance, and of no distance.
flMaxSpeedThe greatest speed.

The documentation for this class was generated from the following file: