Commit 4ba0eaf2 authored by Oliver Bock's avatar Oliver Bock

Improved accuracy

parent 032592bb
......@@ -255,7 +255,7 @@ void PulsarAnimationWidget::updateCameraPosition(const int angleH, const int ang
m_cameraPosX = sin(angleH * deg2rad) * zoom;
m_cameraPosY = sin(angleV * deg2rad) * zoom;
m_cameraPosZ = cos(angleH * deg2rad) * cos(abs(angleV * deg2rad)) * zoom;
m_cameraPosZ = cos(angleH * deg2rad) * cos(fabs(angleV * deg2rad)) * zoom;
updateGL();
}
......@@ -267,7 +267,7 @@ void PulsarAnimationWidget::setFramePerSecond(const unsigned int fps)
void PulsarAnimationWidget::setPulsarSpinFrequency(const float frequency)
{
m_pulsarSpinFrequency = (unsigned int) (1000 / (frequency * 360.0f));
m_pulsarSpinFrequency = (unsigned int) (1000 / (frequency * 360.0f) + 0.5f);
m_pulsarSpinTimer.setInterval(m_pulsarSpinFrequency);
}
......@@ -279,6 +279,6 @@ void PulsarAnimationWidget::setOrbitRadius(const float radius)
void PulsarAnimationWidget::setOrbitFrequency(const float frequency)
{
m_orbitFrequency = (unsigned int) (1000 / (frequency * 360.0f));
m_orbitFrequency = (unsigned int) (1000 / (frequency * 360.0f) + 0.5f);
m_orbitTimer.setInterval(m_orbitFrequency);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment