Photon Fusion 1.1.9

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

T T float? alpha GetValues (bool? force=null)
 
delegate T InterpDelegate (int *from, int *to, float t, float a)
 
 Interpolator (NetworkBehaviour behaviour, InterpDelegate interpDelegate, ReadDelegate readDelegate, int offset, Accuracy accuracy)
 
delegate T ReadDelegate (int *ptr, float a)
 
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.
 

Public Attributes

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

Properties

NetworkBehaviour Behaviour [get]
 
InterpDelegate InterpolationDelegate [get, set]
 
int Offset [get]
 
ReadDelegate ReaderDelegate [get]
 
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 [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
 

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.