Class: InterpolatedPosition
Helper class for adding position interpolation to various systems.
Constructors
constructor
• new InterpolatedPosition(): InterpolatedPosition
Returns
Properties
steps
• Private
steps: [null
| IPosition
, null
| IPosition
]
Methods
get
▸ get(t
): null
| IPosition
Get interpolated position. The t
parameter should be a value between 0 and 1 that tells
the progress percentage of the last uncompleted step, ie. the engine’s timeRemainder
divided by the engine’s timeStep
.
Parameters
Name | Type | Description |
---|---|---|
t |
number |
Interpolation value |
Returns
null
| IPosition
set
▸ set(position
): void
Update the position. Should be called once per step
update.
Parameters
Name | Type | Description |
---|---|---|
position |
IPosition |
New position |
Returns
void