| Linderdaum Engine: clFlingHandler Class Reference | ![]() |
Fling gesture handler. More...
#include <Gestures.h>
Public Member Functions | |
| clFlingHandler () | |
| virtual | ~clFlingHandler () |
| virtual void | AfterConstruction () |
| void | Reset () |
| Clear current state. | |
| void | SetIncrementalRotationMode (const vec2 &ElementaryRotation, const vec2 &AnimSpeed) |
| Switch to incremental rotation (half-pi rotations, 2pi-periodic) | |
| void | SetStrokeMode () |
| Handle isolated free-form strokes and send OnFling events. | |
| virtual void | Event_TIMER (LEvent Event, const LEventArgs &Args) |
| Default event handler. | |
| void | SetValue (const vec2 &NewValue) |
| Set new target value (animation will do the rest) | |
| vec2 | GetValue () const |
| Get current value. | |
| void | SetActive (bool Active) |
| Activate or deactivate flinging. | |
| bool | IsActive () const |
| Check flinging activity. | |
Public Attributes | |
| bool | FActive |
| Are we active (updating) | |
| vec2 | FStepGranularity |
| Single step (1 page or, e.g., PI/2 for rotations) - animation speed. | |
| vec2 | FValueGranularity |
| The discrete sizeof a single motion (angle of elementary rotation or some interval between items in coverflow) | |
| vec2 | FSensitivity |
| Sensitivity a.k.a. movement speed. | |
| vec2 | FValuePeriod |
| Period for values (2 * PI for rotations) | |
| vec2 | FStep |
| Current fling step. | |
| vec2 | FMinValue |
| Minimum axis values. | |
| vec2 | FMaxValue |
| Maximum axis values. | |
| LFlingStatus | FFlingStatus |
| Internal Fling state. | |
Private Member Functions | |
| void | Update (float dt) |
| Function to update the Fling state. Increments values and optionally send events. | |
| void | SetTheValue (float Dir, float Granularity, float *Step, int *StepsLeft) |
| void | UpdateValue (float *ValuePtr, float Step, int *StepsLeft, float MinVal, float MaxVal) |
| void | ClipValue (float *ValuePtr, float Granularity, float ValuePeriod, float Step) |
Private Attributes | |
| vec2 | FValue |
| Current X/Y values, altered by fling. | |
| LVector2i | FStepsLeft |
| How much steps left to add to FValue. | |
Fling gesture handler.
Fling autoregisters itself on creation, but starts inactive
Each time an update occurs
| clFlingHandler::clFlingHandler | ( | ) | [inline] |
| clFlingHandler::~clFlingHandler | ( | ) | [virtual] |
| void clFlingHandler::AfterConstruction | ( | ) | [virtual] |
Reimplemented from clGestureHandler.
| void clFlingHandler::ClipValue | ( | float * | ValuePtr, |
| float | Granularity, | ||
| float | ValuePeriod, | ||
| float | Step | ||
| ) | [inline, private] |
| void clFlingHandler::Event_TIMER | ( | LEvent | Event, |
| const LEventArgs & | Args | ||
| ) | [virtual] |
Default event handler.
| vec2 clFlingHandler::GetValue | ( | ) | const [inline] |
Get current value.
| bool clFlingHandler::IsActive | ( | ) | const [inline] |
Check flinging activity.
| void clFlingHandler::Reset | ( | ) | [inline] |
Clear current state.
| void clFlingHandler::SetActive | ( | bool | Active | ) | [inline] |
Activate or deactivate flinging.
| void clFlingHandler::SetIncrementalRotationMode | ( | const vec2 & | ElementaryRotation, |
| const vec2 & | AnimSpeed | ||
| ) | [inline] |
Switch to incremental rotation (half-pi rotations, 2pi-periodic)
| void clFlingHandler::SetStrokeMode | ( | ) | [inline] |
Handle isolated free-form strokes and send OnFling events.
| void clFlingHandler::SetTheValue | ( | float | Dir, |
| float | Granularity, | ||
| float * | Step, | ||
| int * | StepsLeft | ||
| ) | [inline, private] |
| void clFlingHandler::SetValue | ( | const vec2 & | NewValue | ) |
Set new target value (animation will do the rest)
| void clFlingHandler::Update | ( | float | dt | ) | [inline, private] |
Function to update the Fling state. Increments values and optionally send events.
Deactivate
| void clFlingHandler::UpdateValue | ( | float * | ValuePtr, |
| float | Step, | ||
| int * | StepsLeft, | ||
| float | MinVal, | ||
| float | MaxVal | ||
| ) | [inline, private] |
Are we active (updating)
Internal Fling state.
Maximum axis values.
Minimum axis values.
Sensitivity a.k.a. movement speed.
Current fling step.
Single step (1 page or, e.g., PI/2 for rotations) - animation speed.
LVector2i clFlingHandler::FStepsLeft [private] |
How much steps left to add to FValue.
vec2 clFlingHandler::FValue [private] |
Current X/Y values, altered by fling.
Property(Name=Granularity, Type=vec2, FieldName=FValueGranularity) Property(Name=Period, Type=vec2, FieldName=FValuePeriod) Property(Name=MinValue, Type=vec2, FieldName=FMinValue) Property(Name=MaxValue, Type=vec2, FieldName=FMaxValue) Property(Name=Step, Type=vec2, FieldName=FStep) Property(Name=Sensitivity, Type=vec2, FieldName=FSensitivity) Property(Name=Active, Type=bool, Getter=IsActive, Setter=SetActive)
The discrete sizeof a single motion (angle of elementary rotation or some interval between items in coverflow)
Period for values (2 * PI for rotations)