예제 #1
0
void Transition3Dto2D::startTransition(float duration, bool inReverse,
        bool keepRendering)
{
    animationLength = duration;
    animationDirection = inReverse ? -1 : 1;
    renderAfterCompletion = keepRendering;

    animationStartTime = getCurrentTimeMS();
    animationFinished = false;
}
예제 #2
0
float Transition3Dto2D::stepTransition()
{
    float timeElapsed = (getCurrentTimeMS() - animationStartTime) / 1000.0f;

    float t = timeElapsed / animationLength;
    if (t >= 1.0f)
    {
        t = 1.0f;
        animationFinished = true;
    }

    if (animationDirection == -1)
    {
        t = 1.0f - t;
    }

    return t;
}
예제 #3
0
GEvent::GEvent(EventClass eventClass,
                 EventType eventType,
                 const std::string& eventName,
                 GObservable* source)
        :
          _actionCommand(""),
          _class(eventClass),
          _keyChar('\0'),
          _keyCode(0),
          _modifiers(0),
          _name(eventName),
          _source(source),
          _time(getCurrentTimeMS()),
          _type(eventType),
          _x(0),
          _y(0),
          _row(0),
          _col(0),
          _internalQtEvent(nullptr) {
    // empty
}