![]() |
Jolt Physics
A multi core friendly Game Physics Engine
|
Gradient along a hair strand of a value, e.g. compliance, friction, etc. More...
#include <HairSettings.h>
Public Member Functions | |
| Gradient ()=default | |
| Gradient (float inMin, float inMax, float inMinFraction=0.0f, float inMaxFraction=1.0f) | |
| Gradient | MakeStepDependent (float inTimeRatio) const |
| void | SaveBinaryState (StreamOut &inStream) const |
| Saves the state of this object in binary form to inStream. Doesn't store the compute buffers. | |
| void | RestoreBinaryState (StreamIn &inStream) |
| Restore the state of this object from inStream. | |
Public Attributes | |
| float | mMin = 0.0f |
| Minimum value of the gradient. | |
| float | mMax = 1.0f |
| Maximum value of the gradient. | |
| float | mMinFraction = 0.0f |
| Fraction along the hair strand that corresponds to the minimum value. | |
| float | mMaxFraction = 1.0f |
| Fraction along the hair strand that corresponds to the maximum value. | |
Gradient along a hair strand of a value, e.g. compliance, friction, etc.
|
default |
|
inline |
|
inline |
We drive a value to its target with fixed time steps using:
x(t + fixed_dt) = target + (1 - k) * (x(t) - target)
For varying time steps we can rewrite this to:
x(t + dt) = target + (1 - k)^inTimeRatio * (x(t) - target)
Where inTimeRatio is defined as dt / fixed_dt.
This means k' = 1 - (1 - k)^inTimeRatio
| void HairSettings::Gradient::RestoreBinaryState | ( | StreamIn & | inStream | ) |
Restore the state of this object from inStream.
| void HairSettings::Gradient::SaveBinaryState | ( | StreamOut & | inStream | ) | const |
Saves the state of this object in binary form to inStream. Doesn't store the compute buffers.
| float HairSettings::Gradient::mMax = 1.0f |
Maximum value of the gradient.
| float HairSettings::Gradient::mMaxFraction = 1.0f |
Fraction along the hair strand that corresponds to the maximum value.
| float HairSettings::Gradient::mMin = 0.0f |
Minimum value of the gradient.
| float HairSettings::Gradient::mMinFraction = 0.0f |
Fraction along the hair strand that corresponds to the minimum value.