Commit fb2caaff authored by Oliver Bock's avatar Oliver Bock
Browse files

Ensure that orbital planes overlap nicely

parent c9bfa5fa
...@@ -304,23 +304,33 @@ void PulsarAnimationWidget::paintGL() ...@@ -304,23 +304,33 @@ void PulsarAnimationWidget::paintGL()
if(m_cameraInteraction) { if(m_cameraInteraction) {
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, translucent); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, translucent);
// companion static float sizeOffset = 0.25f;
glPushMatrix();
glRotatef(90.0f, 1.0f, 0.0f, 0.0f); // companion's plane (only if not identical with pulsar's)
glTranslatef(0.0f, 0.0f, 0.0f); if(m_companionSemiMajorAxis != m_pulsarSemiMajorAxis) {
gluDisk(m_quadricCompanionOrbitPlane, glPushMatrix();
m_companionSemiMajorAxis - 0.25f, glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
m_companionSemiMajorAxis + 0.25f,
64, 1); // separate them slightly in case of overlap
glPopMatrix(); // based on ugly mass diff check (no collision detection)
// single known problematic pair: (m_c=1.4, m_p=1.5)
if((int)(10*(m_pulsarMass-m_companionMass)+0.5f) == 1){
glTranslatef(0.0f, 0.0f, 0.01f);
}
gluDisk(m_quadricCompanionOrbitPlane,
m_companionSemiMajorAxis - sizeOffset,
m_companionSemiMajorAxis + sizeOffset,
64, 1);
glPopMatrix();
}
// pulsar // pulsar's plane
glPushMatrix(); glPushMatrix();
glRotatef(90.0f, 1.0f, 0.0f, 0.0f); glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
glTranslatef(0.0f, 0.0f, 0.1f);
gluDisk(m_quadricPulsarOrbitPlane, gluDisk(m_quadricPulsarOrbitPlane,
m_pulsarSemiMajorAxis - 0.25f, m_pulsarSemiMajorAxis - sizeOffset,
m_pulsarSemiMajorAxis + 0.25f, m_pulsarSemiMajorAxis + sizeOffset,
64, 1); 64, 1);
glPopMatrix(); glPopMatrix();
} }
......
Supports Markdown
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