Struct Smoothing
- Namespace
- Coherence.Interpolation
- Assembly
- Coherence.Interpolation.dll
Provides smoothing using SmoothDamp for types: float, Vector2, Vector3 and Quaternion. Smoothing unlike ordinary interpolation, cannot be rewinded, so keep smoothing at a minimum for accurate hitbox rewind. Quaternion smoothing uses SmoothDampAngle for its three euler angles, which may cause a performance hit for large number of objects.
public struct Smoothing
Fields
Empty
public static readonly Smoothing Empty
Field Value
default
public static readonly Smoothing @default
Field Value
maxSpeed
Maximum SmoothDamp speed allowed. Zero means no maximum is imposed.
public float maxSpeed
Field Value
- See Also
smoothTime
Seconds to remain behind the current interpolation point. Applied using Mathf.SmoothDamp (or Mathf.SmoothDampAngle for Quaternions).
public float smoothTime
Field Value
- See Also
Methods
SmoothDouble(double, double, double)
public double SmoothDouble(double currentValue, double targetValue, double time)
Parameters
Returns
SmoothFloat(float, float, double)
public float SmoothFloat(float currentValue, float targetValue, double time)
Parameters
Returns
SmoothQuaternion(Quaternion, Quaternion, double)
public Quaternion SmoothQuaternion(Quaternion currentValue, Quaternion targetValue, double time)
Parameters
currentValue
QuaterniontargetValue
Quaterniontime
double
Returns
SmoothVector2(Vector2, Vector2, double)
public Vector2 SmoothVector2(Vector2 currentValue, Vector2 targetValue, double time)
Parameters
Returns
SmoothVector3(Vector3, Vector3, double)
public Vector3 SmoothVector3(Vector3 currentValue, Vector3 targetValue, double time)
Parameters
currentValue
Vector3targetValue
Vector3time
double
Returns
- Vector3