ComputerGraphik TU WIEN
|
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...
#include <mouseSemantics.hpp>
Public Member Functions | |
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) |
Private Member Functions | |
float | calculateScaleFactor () |
Private Attributes | |
glm::vec2 | latestPos |
int | distance |
float | M |
float | C |
float | m |
float | additionalScaling |
bool | scaleLinear |
bool | inWindow |
bool | firstTimeInWindow |
bool | focused |
bool | inverseScaleFunction |
GLFWwindow * | window |
GLuint | vboPositions |
Texture * | texture |
Additional Inherited Members | |
![]() | |
typedef std::vector< std::pair< double, glm::mat4 > > | Animation |
![]() | |
GLuint | vao |
Scene * | scene |
Model * | model |
Shader * | shader |
glm::mat4 | modelMatrix |
std::string | name |
std::weak_ptr< SceneObject > | parent |
std::vector< std::shared_ptr< SceneObject > > | childs |
std::map< std::string, std::unique_ptr< SceneObject > > | effectChilds |
size_t | animIDX |
Animation | animation |
bool | norender |
bool | isVolSun |
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
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:
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:
|
virtual |
|
private |
void MouseSemantics::cursorEnterCallBack | ( | GLFWwindow * | window, |
int | entered | ||
) |
void MouseSemantics::draw | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
void MouseSemantics::keyCallback | ( | GLFWwindow * | window, |
int | key, | ||
int | scancode, | ||
int | action, | ||
int | mods | ||
) |
|
inline |
|
virtual |
Reimplemented from SceneObject.
void MouseSemantics::toggleScaleFunction | ( | ) |
|
virtual |
Reimplemented from SceneObject.
void MouseSemantics::updateDistanceState | ( | unsigned int | _distance | ) |
void MouseSemantics::windowFocusCallBack | ( | GLFWwindow * | window, |
int | entered | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |