Table of Contents

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

Smoothing

default

public static readonly Smoothing @default

Field Value

Smoothing

maxSpeed

Maximum SmoothDamp speed allowed. Zero means no maximum is imposed.

public float maxSpeed

Field Value

float
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

float
See Also

Methods

SmoothDouble(double, double, double)

public double SmoothDouble(double currentValue, double targetValue, double time)

Parameters

currentValue double
targetValue double
time double

Returns

double

SmoothFloat(float, float, double)

public float SmoothFloat(float currentValue, float targetValue, double time)

Parameters

currentValue float
targetValue float
time double

Returns

float

SmoothQuaternion(Quaternion, Quaternion, double)

public Quaternion SmoothQuaternion(Quaternion currentValue, Quaternion targetValue, double time)

Parameters

currentValue Quaternion
targetValue Quaternion
time double

Returns

Quaternion

SmoothVector2(Vector2, Vector2, double)

public Vector2 SmoothVector2(Vector2 currentValue, Vector2 targetValue, double time)

Parameters

currentValue Vector2
targetValue Vector2
time double

Returns

Vector2

SmoothVector3(Vector3, Vector3, double)

public Vector3 SmoothVector3(Vector3 currentValue, Vector3 targetValue, double time)

Parameters

currentValue Vector3
targetValue Vector3
time double

Returns

Vector3