DustyEngine::InterpolatedTask Class Reference

InterpolatedTask is a task which allows for time-based interpolation of a value from 0 to 1. More...

#include <dustyinterpolatedtask.h>

Inheritance diagram for DustyEngine::InterpolatedTask:

DustyEngine::DummyTask DustyEngine::Task DustyEngine::ColorInterpolatedTask DustyEngine::VectorInterpolatedTask DustyEngine::MoveInterpolatedTask DustyEngine::RotateInterpolatedTask DustyEngine::ScaleInterpolatedTask DustyEngine::WaypointMoveInterpolatedTask DustyEngine::WaypointRotateInterpolatedTask DustyEngine::WaypointScaleInterpolatedTask List of all members.

Public Member Functions

 InterpolatedTask ()
 Constructor sets default values.
virtual ~InterpolatedTask ()
irr::f32 GetInterpolationValue ()
void SetLooping (bool loop)
 SetLooping() sets whether or not the interpolation should loop back to the beginning once it reaches the end.
bool GetLooping ()
void SetReverseLooping (bool reverse)
bool GetReverseLooping ()
void Reverse ()
 Reverse() will cause the interpolation of the task to turn in reverse. If it is interpolating up it will begin interpolating down, if it's going down it will start going up.
bool IsInReverse ()
void SetInterpolationValue (irr::f32 value)
void SetInterpolationTime (irr::u32 time)
irr::u32 GetInterpolationTime ()
void OnUpdate ()
 OnUpdate() is called by the TaskTree when the time has come to execute the task's code.

Protected Member Functions

void UpdateTimeDelta ()
void UpdateLooping ()

Protected Attributes

irr::u32 timePassed
irr::u32 interpolationTime
bool looping
bool reverseLooping
bool inReverse

Detailed Description

InterpolatedTask is a task which allows for time-based interpolation of a value from 0 to 1.

InterpolatedTask allows for interpolation for any purpose. The programmer sets an amount of time that he would like the entire interpolation to take, say 1000 milliseconds, and the task will allow the computation of a value which represents how much of that 1000 milliseconds has passed.

For instance, if the programmer sets the interpolation time to be 1000 milliseconds, and 250 milliseconds has passed, then the GetInterpolationValue() function will return 0.250 because one quarter of the total amount of time has passed.

Definition at line 18 of file dustyinterpolatedtask.h.


Constructor & Destructor Documentation

DustyEngine::InterpolatedTask::InterpolatedTask  ) 
 

Constructor sets default values.

virtual DustyEngine::InterpolatedTask::~InterpolatedTask  )  [virtual]
 


Member Function Documentation

irr::u32 DustyEngine::InterpolatedTask::GetInterpolationTime  )  [inline]
 

GetInterpolationTime() returns the total amount of time it should take for this task to interpolate from 0 to 1.

Returns:
Returns the interpolation time.

Definition at line 81 of file dustyinterpolatedtask.h.

irr::f32 DustyEngine::InterpolatedTask::GetInterpolationValue  ) 
 

Interpolation value works off of the TaskTree. This benefit of this means that if the interpolation task is paused, then the interpolation will also pause. This is keeping with DustyEngine's benefit of seamless pausing/unpausing of tasks.

bool DustyEngine::InterpolatedTask::GetLooping  )  [inline]
 

GetLooping() returns whether or not the interpolation is looping.

Returns:
Returns if the interpolation loops or not.

Definition at line 39 of file dustyinterpolatedtask.h.

bool DustyEngine::InterpolatedTask::GetReverseLooping  )  [inline]
 

GetReverseLooping() returns whether or not the task is set to loop in reverse after it reaches 1.

Returns:
Returns true if the task will loop in reverse after it reaches 1, and false if not.

Definition at line 50 of file dustyinterpolatedtask.h.

bool DustyEngine::InterpolatedTask::IsInReverse  )  [inline]
 

IsInReverse() tells whether the task is current interpolating downward or not.

Returns:
Returns true if if the task is interpolating downward from 1, and false if the task is interpolating upward from 0.

Definition at line 63 of file dustyinterpolatedtask.h.

void DustyEngine::InterpolatedTask::OnUpdate  )  [virtual]
 

OnUpdate() is called by the TaskTree when the time has come to execute the task's code.

OnUpdate is typically the most important function. OnUpdate is only called when enough time has passed or every frame, depending upon what the priority of the task is. If you want code to execute on a time-based basis, put that code here and add the task to the tree.

Reimplemented from DustyEngine::DummyTask.

Reimplemented in DustyEngine::ColorInterpolatedTask, DustyEngine::MoveInterpolatedTask, DustyEngine::RotateInterpolatedTask, DustyEngine::ScaleInterpolatedTask, DustyEngine::VectorInterpolatedTask, DustyEngine::WaypointMoveInterpolatedTask, DustyEngine::WaypointRotateInterpolatedTask, and DustyEngine::WaypointScaleInterpolatedTask.

void DustyEngine::InterpolatedTask::Reverse  )  [inline]
 

Reverse() will cause the interpolation of the task to turn in reverse. If it is interpolating up it will begin interpolating down, if it's going down it will start going up.

Definition at line 56 of file dustyinterpolatedtask.h.

void DustyEngine::InterpolatedTask::SetInterpolationTime irr::u32  time  )  [inline]
 

SetInterpolationTime sets the total amount of time it should take for the interpolation to move from 0 to 1.

Parameters:
time,: The total amount of time it should take.

Reimplemented in DustyEngine::WaypointMoveInterpolatedTask, DustyEngine::WaypointRotateInterpolatedTask, and DustyEngine::WaypointScaleInterpolatedTask.

Definition at line 74 of file dustyinterpolatedtask.h.

void DustyEngine::InterpolatedTask::SetInterpolationValue irr::f32  value  ) 
 

SetInterpolationValue() will update the amount of time that has passed based upon a floating pointer integer from 0 to 1.

Parameters:
value,: The new interpolation value for the task.

void DustyEngine::InterpolatedTask::SetLooping bool  loop  ) 
 

SetLooping() sets whether or not the interpolation should loop back to the beginning once it reaches the end.

void DustyEngine::InterpolatedTask::SetReverseLooping bool  reverse  ) 
 

SetReverseLooping will cause the interpolation to loop backwards once the end of interpolation has been reached. The task will go from 0...1, then from 1...0, then 0...1, forever.

Parameters:
reverse,: If reverse is true, the task will loop in reverse. If it is false, the task will not loop in reverse.

void DustyEngine::InterpolatedTask::UpdateLooping  )  [protected]
 

void DustyEngine::InterpolatedTask::UpdateTimeDelta  )  [protected]
 


Member Data Documentation

bool DustyEngine::InterpolatedTask::inReverse [protected]
 

Definition at line 96 of file dustyinterpolatedtask.h.

irr::u32 DustyEngine::InterpolatedTask::interpolationTime [protected]
 

Definition at line 93 of file dustyinterpolatedtask.h.

bool DustyEngine::InterpolatedTask::looping [protected]
 

Definition at line 94 of file dustyinterpolatedtask.h.

bool DustyEngine::InterpolatedTask::reverseLooping [protected]
 

Definition at line 95 of file dustyinterpolatedtask.h.

irr::u32 DustyEngine::InterpolatedTask::timePassed [protected]
 

Definition at line 92 of file dustyinterpolatedtask.h.


The documentation for this class was generated from the following file:
Generated on Fri Jan 27 17:31:59 2006 for Dusty Engine by  doxygen 1.4.6-NO