Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
fb2caaff
Commit
fb2caaff
authored
Jan 29, 2009
by
Oliver Bock
Browse files
Ensure that orbital planes overlap nicely
parent
c9bfa5fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pulsaranimationwidget.cpp
View file @
fb2caaff
...
...
@@ -304,23 +304,33 @@ void PulsarAnimationWidget::paintGL()
if
(
m_cameraInteraction
)
{
glMaterialfv
(
GL_FRONT
,
GL_AMBIENT_AND_DIFFUSE
,
translucent
);
// companion
glPushMatrix
();
glRotatef
(
90.0
f
,
1.0
f
,
0.0
f
,
0.0
f
);
glTranslatef
(
0.0
f
,
0.0
f
,
0.0
f
);
gluDisk
(
m_quadricCompanionOrbitPlane
,
m_companionSemiMajorAxis
-
0.25
f
,
m_companionSemiMajorAxis
+
0.25
f
,
64
,
1
);
glPopMatrix
();
static
float
sizeOffset
=
0.25
f
;
// companion's plane (only if not identical with pulsar's)
if
(
m_companionSemiMajorAxis
!=
m_pulsarSemiMajorAxis
)
{
glPushMatrix
();
glRotatef
(
90.0
f
,
1.0
f
,
0.0
f
,
0.0
f
);
// separate them slightly in case of overlap
// 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.5
f
)
==
1
){
glTranslatef
(
0.0
f
,
0.0
f
,
0.01
f
);
}
gluDisk
(
m_quadricCompanionOrbitPlane
,
m_companionSemiMajorAxis
-
sizeOffset
,
m_companionSemiMajorAxis
+
sizeOffset
,
64
,
1
);
glPopMatrix
();
}
// pulsar
// pulsar
's plane
glPushMatrix
();
glRotatef
(
90.0
f
,
1.0
f
,
0.0
f
,
0.0
f
);
glTranslatef
(
0.0
f
,
0.0
f
,
0.1
f
);
gluDisk
(
m_quadricPulsarOrbitPlane
,
m_pulsarSemiMajorAxis
-
0.25
f
,
m_pulsarSemiMajorAxis
+
0.25
f
,
m_pulsarSemiMajorAxis
-
sizeOffset
,
m_pulsarSemiMajorAxis
+
sizeOffset
,
64
,
1
);
glPopMatrix
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment