Beispiel #1
0
void Particle::move()
{
	this->basePositionVector += this->directionVector * velocity;
	glm::vec3 norm = getUprightNormVector(this->directionVector);
	setBasePositions(this->basePositionVector, norm);
	setPeak(this->basePositionVector);
}
Beispiel #2
0
Cone::Cone( Vector2D peak,
	    float fstAngle, float sndAngle,
	    float maxDistance, float minDistance ) {
  setPeak( peak );
  setAngles( fstAngle, sndAngle );
  setMaxDistance( maxDistance );
  setMinDistance( minDistance );
}
Beispiel #3
0
void Particle::init(glm::vec3 basePosVector, glm::vec3 aDirectionVector, glm::vec3 normVector)
{
	this->basePositionVector = basePosVector;
	this->vertexArrayIDParticle = 0;
	this->positionVector.resize(3);
	this->directionVector = normalizeVector(aDirectionVector);
	setPeak(basePosVector);
	setBasePositions(basePosVector, normVector);
	this->velocity = VELOCITY;
}
Beispiel #4
0
void WVuMeter::onConnectedControlChanged(double dParameter, double dValue) {
    Q_UNUSED(dValue);
    m_dParameter = math_clamp(dParameter, 0.0, 1.0);

    if (dParameter > 0.0) {
        setPeak(dParameter);
    } else {
        // A 0.0 value is very unlikely except when the VU Meter is disabled
        m_dPeakParameter = 0;
    }

    updateState(m_timer.restart());
}
Beispiel #5
0
void WVuMeter::onConnectedControlValueChanged(double dValue) {
    int idx = static_cast<int>(dValue * m_iNoPos);
    // Range check
    if (idx > m_iNoPos)
        idx = m_iNoPos;
    else if (idx < 0)
        idx = 0;

    setPeak(idx);

    QTime currentTime = QTime::currentTime();
    int msecsElapsed = m_lastUpdate.msecsTo(currentTime);
    m_lastUpdate = currentTime;
    updateState(msecsElapsed);
}
Beispiel #6
0
void WVuMeter::setValue(double fValue)
{
    int idx = (int)(fValue * (float)(m_iNoPos)/128.);
    // Range check
    if (idx>m_iNoPos)
        idx = m_iNoPos;
    else if (idx<0)
        idx = 0;

    setPeak(idx);
    m_value = fValue;

    QTime currentTime = QTime::currentTime();
    int msecsElapsed = m_lastUpdate.msecsTo(currentTime);
    m_lastUpdate = currentTime;
    updateState(msecsElapsed);

    //Post a paintEvent() message, so that the widget repaints.
    update();
}
Beispiel #7
0
void WVuMeter::onConnectedControlValueChanged(double dValue) {
    int idx = static_cast<int>(dValue * m_iNoPos);
    // Range check
    if (idx > m_iNoPos)
        idx = m_iNoPos;
    else if (idx < 0)
        idx = 0;

    if (dValue > 0.) {
        setPeak(idx);
    } else {
        // A 0.0 value is very unlikely except when the VU Meter is disabled
        m_iPeakPos = 0;
    }


    QTime currentTime = QTime::currentTime();
    int msecsElapsed = m_lastUpdate.msecsTo(currentTime);
    m_lastUpdate = currentTime;
    updateState(msecsElapsed);
}
Beispiel #8
0
void WVuMeter::onConnectedControlChanged(double dParameter, double dValue) {
    Q_UNUSED(dValue);
    m_iPos = static_cast<int>(dParameter * m_iNoPos);
    // Range check
    if (m_iPos > m_iNoPos) {
        m_iPos = m_iNoPos;
    } else if (m_iPos < 0) {
        m_iPos = 0;
    }

    if (dParameter > 0.) {
        setPeak(m_iPos);
    } else {
        // A 0.0 value is very unlikely except when the VU Meter is disabled
        m_iPeakPos = 0;
    }

    // TODO: use something much more lightweight than currentTime.
    QTime currentTime = QTime::currentTime();
    int msecsElapsed = m_lastUpdate.msecsTo(currentTime);
    m_lastUpdate = currentTime;
    updateState(msecsElapsed);
}
Beispiel #9
0
void Fader::setPeak_R( float fPeak )
{
	setPeak( fPeak, m_fPeakValue_R, m_persistentPeak_R, m_lastPeakTime_R );
}
Beispiel #10
0
void fader::setPeak_L( float fPeak )
{
	setPeak( fPeak, m_fPeakValue_L, m_persistentPeak_L, m_lastPeakTime_L );
}