Helper class to interpolate values between states. It has mechanics to smoothen unreliable intervals of state and can interpolate simple values such as number
, as well as complex: pc.Vec2, pc.Vec3, pc.Vec4, pc.Quat, pc.Color.
.value : number
| pc.Vec2 | pc.Vec3 | pc.Vec4 | pc.Quat | pc.Color
set(value)
add(value)
update(dt)
Current Value, that it interpolated between states on every update.
Param | Type | Description |
---|---|---|
value | number | pc.Vec2 | pc.Vec3 | pc.Vec4 | pc.Quat | pc.Color |
Value to interpolate. Can be a simple number , as well as complex: pc.Vec2, pc.Vec3, pc.Vec4, pc.Quat, pc.Color object with lerp or slerp , copy and clone method. |
Force a value set, ignoring an interpolation.
Param | Type |
---|---|
value | number | pc.Vec2 | pc.Vec3 | pc.Vec4 | pc.Quat | pc.Color |
Add a value to list of interpolation states.
Param | Type |
---|---|
value | number | pc.Vec2 | pc.Vec3 | pc.Vec4 | pc.Quat | pc.Color |
Call an update, with should be called at the application update interval. This will progress interpolation through states based on Delta Time.
Param | Type | Description |
---|---|---|
dt | number |
Delta Time of an application update frequency. |