Table of Contents

Class Interpolator

Namespace
Coherence.Interpolation
Assembly
Coherence.Interpolation.dll

Base class used for blending between sample points. The base implementation simply provides latest data sampling so that values "snap" to the sample that is latest. By sub-classing and overriding these methods, more refined interpolation can be achieved (see LinearInterpolator and SplineInterpolator). Interpolation can be implemented either using 2 samples or 4 samples. Methods are specified for all supported types, taking sample values as parameters together with the time t that is expressed as a fraction between value1 and value2. Unless the 4 sample methods are overriden, they will simply call the corresponding 2 sample methods that will suffice for most types of interpolation.

public class Interpolator
Inheritance
Interpolator
Derived

Constructors

Interpolator()

public Interpolator()

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 virtual int NumberOfSamplesToStayBehind { get; }

Property Value

int

Methods

InterpolateBoolean(bool, bool, bool, bool, float)

public virtual bool InterpolateBoolean(bool value0, bool value1, bool value2, bool value3, float t)

Parameters

value0 bool
value1 bool
value2 bool
value3 bool
t float

Returns

bool

InterpolateBoolean(bool, bool, float)

public virtual bool InterpolateBoolean(bool value1, bool value2, float t)

Parameters

value1 bool
value2 bool
t float

Returns

bool

InterpolateByte(byte, byte, byte, byte, float)

public virtual byte InterpolateByte(byte value0, byte value1, byte value2, byte value3, float t)

Parameters

value0 byte
value1 byte
value2 byte
value3 byte
t float

Returns

byte

InterpolateByte(byte, byte, float)

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

Parameters

value1 byte
value2 byte
t float

Returns

byte

InterpolateBytes(byte[], byte[], byte[], byte[], float)

public virtual byte[] InterpolateBytes(byte[] value0, byte[] value1, byte[] value2, byte[] value3, float t)

Parameters

value0 byte[]
value1 byte[]
value2 byte[]
value3 byte[]
t float

Returns

byte[]

InterpolateBytes(byte[], byte[], float)

public virtual byte[] InterpolateBytes(byte[] value1, byte[] value2, float t)

Parameters

value1 byte[]
value2 byte[]
t float

Returns

byte[]

InterpolateChar(char, char, char, char, float)

public virtual char InterpolateChar(char value0, char value1, char value2, char value3, float t)

Parameters

value0 char
value1 char
value2 char
value3 char
t float

Returns

char

InterpolateChar(char, char, float)

public virtual char InterpolateChar(char value1, char value2, float t)

Parameters

value1 char
value2 char
t float

Returns

char

InterpolateColor(Color, Color, float)

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

Parameters

value1 Color
value2 Color
t float

Returns

Color

InterpolateColor(Color, Color, Color, Color, float)

public virtual Color InterpolateColor(Color value0, Color value1, Color value2, Color value3, float t)

Parameters

value0 Color
value1 Color
value2 Color
value3 Color
t float

Returns

Color

InterpolateDouble(double, double, double, double, float)

public virtual double InterpolateDouble(double value0, double value1, double value2, double value3, float t)

Parameters

value0 double
value1 double
value2 double
value3 double
t float

Returns

double

InterpolateDouble(double, double, float)

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

Parameters

value1 double
value2 double
t float

Returns

double

InterpolateEntityReference(Entity, Entity, Entity, Entity, float)

public virtual Entity InterpolateEntityReference(Entity value0, Entity value1, Entity value2, Entity value3, float t)

Parameters

value0 Entity
value1 Entity
value2 Entity
value3 Entity
t float

Returns

Entity

InterpolateEntityReference(Entity, Entity, float)

public virtual Entity InterpolateEntityReference(Entity value1, Entity value2, float t)

Parameters

value1 Entity
value2 Entity
t float

Returns

Entity

InterpolateFloat(float, float, float)

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

Parameters

value1 float
value2 float
t float

Returns

float

InterpolateFloat(float, float, float, float, float)

public virtual float InterpolateFloat(float value0, float value1, float value2, float value3, float t)

Parameters

value0 float
value1 float
value2 float
value3 float
t float

Returns

float

InterpolateInt(int, int, int, int, float)

public virtual int InterpolateInt(int value0, int value1, int value2, int value3, float t)

Parameters

value0 int
value1 int
value2 int
value3 int
t float

Returns

int

InterpolateInt(int, int, float)

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

Parameters

value1 int
value2 int
t float

Returns

int

InterpolateLong(long, long, long, long, float)

public virtual long InterpolateLong(long value0, long value1, long value2, long value3, float t)

Parameters

value0 long
value1 long
value2 long
value3 long
t float

Returns

long

InterpolateLong(long, long, float)

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

Parameters

value1 long
value2 long
t float

Returns

long

InterpolateQuaternion(Quaternion, Quaternion, float)

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

Parameters

value1 Quaternion
value2 Quaternion
t float

Returns

Quaternion

InterpolateQuaternion(Quaternion, Quaternion, Quaternion, Quaternion, float)

public virtual Quaternion InterpolateQuaternion(Quaternion value0, Quaternion value1, Quaternion value2, Quaternion value3, float t)

Parameters

value0 Quaternion
value1 Quaternion
value2 Quaternion
value3 Quaternion
t float

Returns

Quaternion

InterpolateSByte(sbyte, sbyte, sbyte, sbyte, float)

public virtual sbyte InterpolateSByte(sbyte value0, sbyte value1, sbyte value2, sbyte value3, float t)

Parameters

value0 sbyte
value1 sbyte
value2 sbyte
value3 sbyte
t float

Returns

sbyte

InterpolateSByte(sbyte, sbyte, float)

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

Parameters

value1 sbyte
value2 sbyte
t float

Returns

sbyte

InterpolateShort(short, short, short, short, float)

public virtual short InterpolateShort(short value0, short value1, short value2, short value3, float t)

Parameters

value0 short
value1 short
value2 short
value3 short
t float

Returns

short

InterpolateShort(short, short, float)

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

Parameters

value1 short
value2 short
t float

Returns

short

InterpolateString(string, string, float)

public virtual string InterpolateString(string value1, string value2, float t)

Parameters

value1 string
value2 string
t float

Returns

string

InterpolateString(string, string, string, string, float)

public virtual string InterpolateString(string value0, string value1, string value2, string value3, float t)

Parameters

value0 string
value1 string
value2 string
value3 string
t float

Returns

string

InterpolateUInt(uint, uint, float)

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

Parameters

value1 uint
value2 uint
t float

Returns

uint

InterpolateUInt(uint, uint, uint, uint, float)

public virtual uint InterpolateUInt(uint value0, uint value1, uint value2, uint value3, float t)

Parameters

value0 uint
value1 uint
value2 uint
value3 uint
t float

Returns

uint

InterpolateULong(ulong, ulong, float)

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

Parameters

value1 ulong
value2 ulong
t float

Returns

ulong

InterpolateULong(ulong, ulong, ulong, ulong, float)

public virtual ulong InterpolateULong(ulong value0, ulong value1, ulong value2, ulong value3, float t)

Parameters

value0 ulong
value1 ulong
value2 ulong
value3 ulong
t float

Returns

ulong

InterpolateUShort(ushort, ushort, float)

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

Parameters

value1 ushort
value2 ushort
t float

Returns

ushort

InterpolateUShort(ushort, ushort, ushort, ushort, float)

public virtual ushort InterpolateUShort(ushort value0, ushort value1, ushort value2, ushort value3, float t)

Parameters

value0 ushort
value1 ushort
value2 ushort
value3 ushort
t float

Returns

ushort

InterpolateVector2(Vector2, Vector2, float)

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

Parameters

value1 Vector2
value2 Vector2
t float

Returns

Vector2

InterpolateVector2(Vector2, Vector2, Vector2, Vector2, float)

public virtual Vector2 InterpolateVector2(Vector2 value0, Vector2 value1, Vector2 value2, Vector2 value3, float t)

Parameters

value0 Vector2
value1 Vector2
value2 Vector2
value3 Vector2
t float

Returns

Vector2

InterpolateVector3(Vector3, Vector3, float)

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

Parameters

value1 Vector3
value2 Vector3
t float

Returns

Vector3

InterpolateVector3(Vector3, Vector3, Vector3, Vector3, float)

public virtual Vector3 InterpolateVector3(Vector3 value0, Vector3 value1, Vector3 value2, Vector3 value3, float t)

Parameters

value0 Vector3
value1 Vector3
value2 Vector3
value3 Vector3
t float

Returns

Vector3