Photon Fusion 1.1.2

Public Member Functions | Public Attributes | Properties | List of all members
NetworkBehaviour.Interpolator< T > Struct Template Reference

Interpolator provides a set of methods to get the "from" and "to" ticks of the associated [Networked] property, as well as the current interpolation value for the two, but it also provides a Value property as a shortcut to get the actual interpolated value for those parameters.

See also
RawInterpolator
More...

Public Member Functions

delegate T InterpDelegate (int *from, int *to, float t, float a)
 
delegate T ReadDelegate (int *ptr, float a)
 
 Interpolator (NetworkBehaviour behaviour, InterpDelegate interpDelegate, ReadDelegate readDelegate, int offset, Accuracy accuracy)
 
bool TryGetValues (out T from, out T to, out float alpha, bool? force=null)
 Try and get 'To' and 'From' states, and the Alpha (t) values needed for interpolation. More...
 
T T float? alpha GetValues (bool? force=null)
 

Public Attributes

float _accuracy
 
int _offset
 
InterpDelegate _interpDelegate
 
ReadDelegate _readDelegate
 
NetworkBehaviour _behaviour
 
from
 Get 'To' and 'From' states, and the Alpha (t) values needed for interpolation. More...
 
T T to
 

Properties

int Offset [get]
 
NetworkBehaviour Behaviour [get]
 
InterpDelegate InterpolationDelegate [get, set]
 
ReadDelegate ReaderDelegate [get]
 
Value [get]
 Get the current interpolation value for this Interpolator. This method will silently ignore missing interpolation data and just return the default value for T More...
 
T? TryValue [get]
 Get the current interpolation value for this Interpolator. Similar to the Value property, but will return null if interpolation data is not available. More...
 

Detailed Description

Interpolator provides a set of methods to get the "from" and "to" ticks of the associated [Networked] property, as well as the current interpolation value for the two, but it also provides a Value property as a shortcut to get the actual interpolated value for those parameters.

See also
RawInterpolator
Type Constraints
T :struct 

Member Function Documentation

◆ TryGetValues()

bool TryGetValues ( out T  from,
out T  to,
out float  alpha,
bool?  force = null 
)

Try and get 'To' and 'From' states, and the Alpha (t) values needed for interpolation.

Parameters
fromValue on the state the interpolation is going from.
toValue on the state the interpolation is going to.
alphaInterpolant factor between the two states.
forceForce interpolation to the current Simulations time frame (as opposed to between snapshots). If no value is forced, interpolation data will be retrieved according to the NetworkBehaviour.InterpolationDataSource.
Returns
True if the interpolation data is available, false otherwise.

Member Data Documentation

◆ from

T from

Get 'To' and 'From' states, and the Alpha (t) values needed for interpolation.

Parameters
forceForce interpolation to the current Simulations time frame (as opposed to between snapshots). If no value is forced, interpolation data will be retrieved according to the NetworkBehaviour.InterpolationDataSource.
Returns
A tuple containing the values. Null if interpolation data is not available.

Property Documentation

◆ TryValue

T? TryValue
get

Get the current interpolation value for this Interpolator. Similar to the Value property, but will return null if interpolation data is not available.

◆ Value

T Value
get

Get the current interpolation value for this Interpolator. This method will silently ignore missing interpolation data and just return the default value for T