mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-07 12:09:38 -06:00
Fix naming of umbral and penumbral shadows
This commit is contained in:
@@ -456,34 +456,9 @@ void RenderableEclipseCone::createCone(double et) {
|
||||
);
|
||||
|
||||
|
||||
// 4. Construct the penumbral shadow
|
||||
std::vector<VBOLayout> penumbralVertices;
|
||||
if (_showPenumbralShadow) {
|
||||
penumbralVertices = calculateShadowPoints(
|
||||
resSrc.terminatorPoints,
|
||||
resDst.terminatorPoints,
|
||||
shadowerToLightSource,
|
||||
lightSourceToShadower,
|
||||
distance * static_cast<double>(_shadowLength)
|
||||
);
|
||||
|
||||
// We need to duplicate the first two vertices to close the cylinder at the seam
|
||||
penumbralVertices.push_back(penumbralVertices[0]);
|
||||
penumbralVertices.push_back(penumbralVertices[1]);
|
||||
}
|
||||
|
||||
|
||||
// 5. Construct the umbral shadow
|
||||
// 4. Construct the umbral shadow
|
||||
std::vector<VBOLayout> umbralVertices;
|
||||
if (_showUmbralShadow) {
|
||||
// For the umbral shadow, we need to mix the terminator points with a 180
|
||||
// degree phase shift, so that the top terminator point of the sun gets matched
|
||||
// with the bottom terminator point of the Moon, etc
|
||||
std::rotate(
|
||||
resSrc.terminatorPoints.begin(),
|
||||
resSrc.terminatorPoints.begin() + resSrc.terminatorPoints.size() / 2,
|
||||
resSrc.terminatorPoints.end()
|
||||
);
|
||||
umbralVertices = calculateShadowPoints(
|
||||
resSrc.terminatorPoints,
|
||||
resDst.terminatorPoints,
|
||||
@@ -498,6 +473,31 @@ void RenderableEclipseCone::createCone(double et) {
|
||||
}
|
||||
|
||||
|
||||
// 5. Construct the penumbral shadow
|
||||
std::vector<VBOLayout> penumbralVertices;
|
||||
if (_showPenumbralShadow) {
|
||||
// For the penumbral shadow, we need to mix the terminator points with a 180
|
||||
// degree phase shift, so that the top terminator point of the sun gets matched
|
||||
// with the bottom terminator point of the Moon, etc
|
||||
std::rotate(
|
||||
resSrc.terminatorPoints.begin(),
|
||||
resSrc.terminatorPoints.begin() + resSrc.terminatorPoints.size() / 2,
|
||||
resSrc.terminatorPoints.end()
|
||||
);
|
||||
penumbralVertices = calculateShadowPoints(
|
||||
resSrc.terminatorPoints,
|
||||
resDst.terminatorPoints,
|
||||
shadowerToLightSource,
|
||||
lightSourceToShadower,
|
||||
distance * static_cast<double>(_shadowLength)
|
||||
);
|
||||
|
||||
// We need to duplicate the first two vertices to close the cylinder at the seam
|
||||
penumbralVertices.push_back(penumbralVertices[0]);
|
||||
penumbralVertices.push_back(penumbralVertices[1]);
|
||||
}
|
||||
|
||||
|
||||
// 6. Combine vertices
|
||||
std::vector<VBOLayout> vertices;
|
||||
vertices.reserve(umbralVertices.size() + penumbralVertices.size());
|
||||
|
||||
Reference in New Issue
Block a user