scheduleInterpolateTask

Schedule a task to interpolate a value over a period of time.

  1. UUID scheduleInterpolateTask(ref T val, T start, T end, Duration duration, T function(T, T, float) interpFunc = &lerp!(T))
    UUID
    scheduleInterpolateTask
    (
    T
    )
    (
    ref T val
    ,,
    T end
    ,
    Duration duration
    ,
    T function(
    T
    ,
    T
    ,
    float
    )
    interpFunc = &lerp!(T)
    )
  2. UUID scheduleInterpolateTask(ref Owner own, T start, T end, Duration duration, T function(T, T, float) interpFunc = &lerp!(T))

Parameters

T

The type to interpolate, either vector or quaternion.

val
Type: T

ref The value to interpolate.

start
Type: T

The starting value for interpolation.

end
Type: T

The target value for interpolation.

interpFunc
Type: T function(
T
,
T
,
float
)

[default=lerp] The function to use for interpolation.

Return Value

Type: UUID

The ID of the task.

Examples

scheduleInterpolateTask( position, startNode, endNode, 100.msecs );
1 import std.stdio;
2 
3 writeln( "Dash Tasks scheduleInterpolateTask unittest 1" );
4 
5 vec3f interpVec = vec3f( 0, 0, 0 );
6 vec3f start = vec3f( 0, 1, 0 );
7 vec3f end = vec3f( 0, 1, 1 );
8 scheduleInterpolateTask( interpVec, start, end, 100.msecs );
9 
10 while( scheduledTasks.length )
11 {
12     Time.update();
13     executeTasks();
14 }
15 
16 assert( interpVec == end );

Meta