Messages |
start | three floats | set the start position |
end | three floats | set the end position |
time | float | set the move time |
go | start the motion |
Comments |
constructor simpleMover
destructor ~simpleMover
method reset
1 set start position to (0,0,0)
2 set end position to (0,0,0)
3 set move time to 1 second
4 set active to false;
5 set forward to false
method message
1 set the start position
2 set the end position
3 set the move time
4 start the motion
method go
1 if not active then
1.1 set active true
1.2 set forward to not forward
1.3 set start time to frame time
method app
1 if active then
1.1 calculate time since start time
1.2 if time is greater than move time
1.2.1 set time to move time1.3 calculate percentage into move
1.2.2 set active to false
1.4 if forward then
1.4.1 interpolate from the start
1.4.1 else, interpolate from the end1.5 set transform position