Table of Contents

Class LinearInterpolator

Namespace
Coherence.Interpolation
Assembly
Coherence.Interpolation.dll

The LinearInterpolator performs a linear blend between two adjacent samples. The LinearInterpolator is defined for types int, long, float, Vector2, Vector3, Color and Quaternion (using UnityEngine.Quaternion.Slerp(UnityEngine.Quaternion,UnityEngine.Quaternion,System.Single)).

public class LinearInterpolator : Interpolator
Inheritance
LinearInterpolator
Inherited Members

Constructors

LinearInterpolator()

public LinearInterpolator()

Properties

NumberOfSamplesToStayBehind

Number of leading samples required for this interpolation method, added to Delay. Linear interpolation requires one sample ahead (and one behind) to produce valid results while splines require two samples ahead and behind. The default Interpolator requires no samples ahead or behind because since it simply applies the most recent sample with no blending.

public override int NumberOfSamplesToStayBehind { get; }

Property Value

int

Methods

InterpolateByte(byte, byte, float)

public override byte InterpolateByte(byte value1, byte value2, float t)

Parameters

value1 byte
value2 byte
t float

Returns

byte

InterpolateColor(Color, Color, float)

public override Color InterpolateColor(Color value1, Color value2, float t)

Parameters

value1 Color
value2 Color
t float

Returns

Color

InterpolateDouble(double, double, float)

public override double InterpolateDouble(double value1, double value2, float t)

Parameters

value1 double
value2 double
t float

Returns

double

InterpolateFloat(float, float, float)

public override float InterpolateFloat(float value1, float value2, float t)

Parameters

value1 float
value2 float
t float

Returns

float

InterpolateInt(int, int, float)

public override int InterpolateInt(int value1, int value2, float t)

Parameters

value1 int
value2 int
t float

Returns

int

InterpolateLong(long, long, float)

public override long InterpolateLong(long value1, long value2, float t)

Parameters

value1 long
value2 long
t float

Returns

long

InterpolateQuaternion(Quaternion, Quaternion, float)

public override Quaternion InterpolateQuaternion(Quaternion value1, Quaternion value2, float t)

Parameters

value1 Quaternion
value2 Quaternion
t float

Returns

Quaternion

InterpolateSByte(sbyte, sbyte, float)

public override sbyte InterpolateSByte(sbyte value1, sbyte value2, float t)

Parameters

value1 sbyte
value2 sbyte
t float

Returns

sbyte

InterpolateShort(short, short, float)

public override short InterpolateShort(short value1, short value2, float t)

Parameters

value1 short
value2 short
t float

Returns

short

InterpolateUInt(uint, uint, float)

public override uint InterpolateUInt(uint value1, uint value2, float t)

Parameters

value1 uint
value2 uint
t float

Returns

uint

InterpolateULong(ulong, ulong, float)

public override ulong InterpolateULong(ulong value1, ulong value2, float t)

Parameters

value1 ulong
value2 ulong
t float

Returns

ulong

InterpolateUShort(ushort, ushort, float)

public override ushort InterpolateUShort(ushort value1, ushort value2, float t)

Parameters

value1 ushort
value2 ushort
t float

Returns

ushort

InterpolateVector2(Vector2, Vector2, float)

public override Vector2 InterpolateVector2(Vector2 value1, Vector2 value2, float t)

Parameters

value1 Vector2
value2 Vector2
t float

Returns

Vector2

InterpolateVector3(Vector3, Vector3, float)

public override Vector3 InterpolateVector3(Vector3 value1, Vector3 value2, float t)

Parameters

value1 Vector3
value2 Vector3
t float

Returns

Vector3