The class which handles the drawing of the cursor as well as the semantic scaling function that translates the movement from motor space to visual space.
More...
|
| MouseSemantics (Scene *scene, float _M, float _C, float _m, Texture *texture) |
|
virtual | ~MouseSemantics () |
|
void | setShader (Shader *shader) |
|
void | draw () |
|
void | update (double deltaT) |
|
void | cursorEnterCallBack (GLFWwindow *window, int entered) |
|
void | windowFocusCallBack (GLFWwindow *window, int entered) |
|
void | keyCallback (GLFWwindow *window, int key, int scancode, int action, int mods) |
|
void | toggleScaleFunction () |
|
void | updateDistanceState (unsigned int _distance) |
|
unsigned int | getDistance () |
|
std::string | scaleFunction () |
|
float | getScaleFactor () |
|
float | getSpeed () |
|
glm::ivec2 | getMousePos () |
|
| SceneObject (std::shared_ptr< SceneObject > &effectParent, const glm::mat4 &modelMatrix=glm::mat4(1)) |
|
| SceneObject (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1)) |
|
virtual | ~SceneObject () |
|
Model * | getModel () const |
|
Shader * | getShader () const |
|
glm::mat4 | getModelMatrix () const |
|
glm::mat4 | getGlobalModelMatrix () const |
|
std::string | getName () const |
|
std::shared_ptr< SceneObject > | getParent () const |
|
void | setAnimationTime (double time) |
|
bool | setAnimation (const Animation &anim) |
|
bool | delChild (size_t idx) |
|
bool | getChild (size_t idx, std::shared_ptr< SceneObject > &child) const |
|
bool | addChild (std::shared_ptr< SceneObject > &child) |
|
bool | remEffect (const std::string &name) |
|
SceneObject * | getEffect (const std::string &name) const |
|
bool | addEffect (const std::string &name, std::unique_ptr< SceneObject > &effect) |
|
bool | doNotRender () |
|
bool | getIsVolSun () |
|
virtual void | reset () |
|
virtual void | draw () const |
|
virtual bool | animate (double time) |
|
The class which handles the drawing of the cursor as well as the semantic scaling function that translates the movement from motor space to visual space.
The purpose of the class MouseSemantics is to
- draw a mouse cursor and scale its appearance and
- scale the movement according to the distance of the nearest object.
The draw method uses point sprites to render the picture of a mouse pointer onto the screen. The size of the cursor is then directly coupled to the distance of the nearest pickable object. The bigger the distance, the bigger the mouse will be rendered.
In addition to rendering, this class also implements the 2 scale functions which are presented in the paper. Important parameters are:
- M maximum mouse speed, default: 3.5
- m minimum mouse speed, default: 0.3
- C cutoff distance (default 200 pixels): when the distance to the nearest pickable object is bigger than this value, mouse movement will always be at maximum specified speed
Standard scale function: (M - m) * (C / D) + M
Inverse scale function: (m - M) / (D + 1)^S + M where D is the actual distance to the nearest object and S is an empirically derived constant (0.1 in our case).
Using F10 one can toggle between the inverse and the standard scale function. Using J and K one can slow down or speed up the overall mouse speed.
The scale functions are depicted as follows:
linear scale function
inverse scale function
- Author
- Felix Koenig