![]() |
Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
|
#include <Picker.hpp>
Public Member Functions | |
id_t | getFocusId () const |
float | getFocusDistance () const |
bool | hasFocusId () const |
uint | maxDistance () const |
HighlightTargetEffect & | highlightEffect () |
void | maxDistance (uint const maxDistance) |
void | updateMode (PickerUpdateMode const mode) |
PickerUpdateMode | updateMode () |
void | onKeyStateChanged (int key, bool pressed) |
Picker (Application *app) | |
void | update (double time, double timeDelta) |
void | draw (double time, double timeDelta) |
void | onWindowSizeChanged (vec2 const &size) |
Private Attributes | |
id_t | m_focusId |
bool | m_hasFocusId |
float | m_focusDistance |
Application * | m_app |
QuadTree | m_quadTree |
HighlightTargetEffect | m_highlightEffect |
PickerUpdateMode | m_mode |
bool | m_modeHasChanged |
Picker is used to find the nearest pickable object to the cursor in screen space. It provides information about the nearest object and its distance to the cursor.
Definition at line 23 of file Picker.hpp.
Picker | ( | Application * | app | ) |
Constructs a Picker-object.
app | The global application. |
Definition at line 5 of file Picker.cpp.
void draw | ( | double | time, |
double | timeDelta | ||
) |
Draws the highlight-effect to highlight the currently focused object.
time | The absolute frame time |
timeDelta | Time since the last frame |
Definition at line 106 of file Picker.cpp.
|
inline |
Accessor to the maximum distance to the cursor (in city-block-distance) that an object can have
Definition at line 44 of file Picker.hpp.
|
inline |
Accessor to the currently focused objects id.
Definition at line 39 of file Picker.hpp.
|
inline |
Accessor to wheter the picker has a focused obejct
Definition at line 49 of file Picker.hpp.
|
inline |
Accessor to the highlighting effect to highlight the focused obejct
Definition at line 59 of file Picker.hpp.
|
inline |
Accessor to the maximum distance to the cursor that an object can have
Definition at line 54 of file Picker.hpp.
void maxDistance | ( | uint const | maxDistance | ) |
Accessor to the maximum distance to the cursor that an object can have
maxDistance | The new maximum distance to the cursor that an object can have. |
Definition at line 34 of file Picker.cpp.
void onKeyStateChanged | ( | int | key, |
bool | pressed | ||
) |
Callback for key-state-changes. Toggles the picker-mode on F1-key.
key | The key |
pressed | Wheter the key was pressed or released |
Definition at line 99 of file Picker.cpp.
void onWindowSizeChanged | ( | vec2 const & | size | ) |
Callback for window-size-changes. Passes this information to the quadtree (if needed) and the hightlight-effect.
size | The new window-size. |
Definition at line 92 of file Picker.cpp.
void update | ( | double | time, |
double | timeDelta | ||
) |
Updates the picker-object. Updates the quad-tree and focus-information (if needed).
time | The absolute frame time |
timeDelta | Time since the last frame |
Definition at line 42 of file Picker.cpp.
void updateMode | ( | PickerUpdateMode const | mode | ) |
Accessor to the current active picker-mode
mode | The new active picker-mode |
Definition at line 18 of file Picker.cpp.
|
inline |
Accessor to the current active picker-mode
Definition at line 74 of file Picker.hpp.
|
private |
The global application
Definition at line 28 of file Picker.hpp.
|
private |
The distance to the cursor that the focused object has
Definition at line 27 of file Picker.hpp.
|
private |
The currently focused objects id
Definition at line 25 of file Picker.hpp.
|
private |
Wheter the picker has a focused obejct
Definition at line 26 of file Picker.hpp.
|
private |
A highlighting effect to highlight the focused obejct
Definition at line 30 of file Picker.hpp.
|
private |
The current active picker-mode
Definition at line 31 of file Picker.hpp.
|
private |
Wheter the picker-mode has changed since the last frame
Definition at line 32 of file Picker.hpp.
|
private |
A quadtree to organize scene-data
Definition at line 29 of file Picker.hpp.