5 , m_tex_arrow(app->getTextures().get(
"hand.gif"))
6 , m_tex_hand(app->getTextures().get(
"arrow.gif"))
10 , m_scale_linear(true)
15 , m_cushion_factor(0.8f)
52 auto deltaLength = glm::length(deltaMotorSpace);
54 if ( deltaLength > glm::epsilon<float>())
56 auto deltaDir = deltaMotorSpace/deltaLength;
58 while( deltaLength > glm::epsilon<float>() )
60 auto length = glm::min( deltaLength, 1.0f );
64 deltaLength -= length;
68 return cursorPosBeforeMove;
89 t = 1.0f - pow((D+1),-s);
103 return cursorPosBeforeMove + deltaMotorSpace * scaleCushion;
108 const double updateDelta = 0.3;
124 auto cursorPos = wnd.getCursor();
129 return vec2(x / wndSize.x, y / wndSize.y);
174 sprite.draw(vec4(r, g, b, 1.0f), px(cursorPos.x, wndSize.y-cursorPos.y), px(tex_size_x*cursor_scale, tex_size_y*cursor_scale), vec2(1,-1),
HAlign::Left,
VAlign::Top);
vec2 calculateCursorPosInVisualSpace(vec2 cursorPosBeforeMove, vec2 const &deltaMotorSpace)
void toggleScaleFunction()
void updateCushionFactor(float value)
SpriteRenderer & getSprites()
float getFocusDistance() const
vec2 calculateCursorMoveDeltaInVisualSpace(vec2 const &cursorPosBeforeMove, vec2 const &deltaMotorSpace)
void update(double time, double timeDelta)
OwnCursor(Application *app)
vec2 const & getSize() const
void onKeyStateChanged(int key, bool pressed)
void draw(double time, double timeDelta)