From 1ce2b8e09e4e0e76a28d5f89a4f5e8a3416871b9 Mon Sep 17 00:00:00 2001 From: Oliver Bock <oliver.bock@aei.mpg.de> Date: Fri, 16 Sep 2011 14:33:26 +0200 Subject: [PATCH] Put pulsar radius into variable --- src/pulsaranimationwidget.cpp | 10 +++++----- src/pulsaranimationwidget.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index 6399a2a..e3198a3 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -77,18 +77,18 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) : // initial binary system parameters (have to match GUI!) m_pulsarMass = 1.4; - // initial companion is "Neutron Star" - m_companionMass = 1.4; + m_pulsarRadius = 1.0; m_pulsarSpinAxisInclination = 0.0; m_pulsarMagneticAxisInclination = 60.0; m_pulsarSemiMajorAxis = 5.0; - m_companionSemiMajorAxis = (m_pulsarMass/m_companionMass) * m_pulsarSemiMajorAxis; // initial spin frequency of 0.5 Hz m_pulsarRotationDelta = (360.0 * 0.5) / m_framesPerSecond; // beam properties (keep this order!) m_pulsarBeamLength = 3.0f; setPulsarBeamAngle(30); - + // initial companion is "Neutron Star" + m_companionMass = 1.4; + m_companionSemiMajorAxis = (m_pulsarMass/m_companionMass) * m_pulsarSemiMajorAxis; // update orbital period (based on settings above) updateOrbitPeriod(); @@ -356,7 +356,7 @@ void PulsarAnimationWidget::paintGL() glEnable(GL_LIGHTING); glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); - gluSphere(m_quadricPulsar, 1.0, 32, 32); + gluSphere(m_quadricPulsar, m_pulsarRadius, 32, 32); glDisable(GL_LIGHTING); } glPopMatrix(); diff --git a/src/pulsaranimationwidget.h b/src/pulsaranimationwidget.h index 7dc21bd..31f15f9 100644 --- a/src/pulsaranimationwidget.h +++ b/src/pulsaranimationwidget.h @@ -104,16 +104,16 @@ private: double m_orbitRotationAngle; double m_orbitRotationDelta; + double m_pulsarRadius; + double m_pulsarBeamLength; + double m_pulsarBeamAngle; + double m_pulsarBeamOuterRadius; double m_pulsarMass; double m_pulsarSemiMajorAxis; - double m_companionMass; - double m_companionSemiMajorAxis; - double m_pulsarSpinAxisInclination; double m_pulsarMagneticAxisInclination; - double m_pulsarBeamLength; - double m_pulsarBeamAngle; - double m_pulsarBeamOuterRadius; + double m_companionMass; + double m_companionSemiMajorAxis; bool m_showOrbits; bool m_showRotationAxes; -- GitLab