void Particle::move() { this->basePositionVector += this->directionVector * velocity; glm::vec3 norm = getUprightNormVector(this->directionVector); setBasePositions(this->basePositionVector, norm); setPeak(this->basePositionVector); }
Cone::Cone( Vector2D peak, float fstAngle, float sndAngle, float maxDistance, float minDistance ) { setPeak( peak ); setAngles( fstAngle, sndAngle ); setMaxDistance( maxDistance ); setMinDistance( minDistance ); }
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; }
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()); }
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); }
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(); }
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); }
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); }
void Fader::setPeak_R( float fPeak ) { setPeak( fPeak, m_fPeakValue_R, m_persistentPeak_R, m_lastPeakTime_R ); }
void fader::setPeak_L( float fPeak ) { setPeak( fPeak, m_fPeakValue_L, m_persistentPeak_L, m_lastPeakTime_L ); }