Meteor.cpp   Meteor.cpp 
skipping to change at line 46 skipping to change at line 46
, m_absMag(.5) , m_absMag(.5)
, m_aptMag(.5) , m_aptMag(.5)
, m_bolideTexture(bolideTexture) , m_bolideTexture(bolideTexture)
, m_segments(10) , m_segments(10)
{ {
} }
Meteor::~Meteor() Meteor::~Meteor()
{ {
m_bolideTexture.clear(); m_bolideTexture.clear();
m_lineColorVector.clear();
m_trainColorVector.clear();
} }
void Meteor::init(const float& radiantAlpha, const float& radiantDelta, void Meteor::init(const float& radiantAlpha, const float& radiantDelta,
const float& speed, const QList<ColorPair> colors) const float& speed, const QList<ColorPair> colors)
{ {
// meteor velocity in km/s // meteor velocity in km/s
m_speed = speed; m_speed = speed;
// find the radiant in horizontal coordinates // find the radiant in horizontal coordinates
Vec3d radiantAltAz; Vec3d radiantAltAz;
skipping to change at line 403 skipping to change at line 405
Vec3d bottomRight = m_position; Vec3d bottomRight = m_position;
bottomRight[1] += bolideSize; bottomRight[1] += bolideSize;
vertexArrayBolide.push_back(radiantToAltAz(bottomRight)); vertexArrayBolide.push_back(radiantToAltAz(bottomRight));
colorArrayBolide.push_back(bolideColor); colorArrayBolide.push_back(bolideColor);
Vec3d bottomLeft = m_position; Vec3d bottomLeft = m_position;
bottomLeft[0] += bolideSize; bottomLeft[0] += bolideSize;
vertexArrayBolide.push_back(radiantToAltAz(bottomLeft)); vertexArrayBolide.push_back(radiantToAltAz(bottomLeft));
colorArrayBolide.push_back(bolideColor); colorArrayBolide.push_back(bolideColor);
glEnable(GL_BLEND); sPainter.setBlending(true, GL_ONE, GL_ONE);
glBlendFunc(GL_ONE, GL_ONE);
sPainter.enableClientStates(true, true, true); sPainter.enableClientStates(true, true, true);
m_bolideTexture->bind(); m_bolideTexture->bind();
static const float texCoordData[] = {1.,0., 0.,0., 0.,1., 1.,1.}; static const float texCoordData[] = {1.,0., 0.,0., 0.,1., 1.,1.};
sPainter.setTexCoordPointer(2, GL_FLOAT, texCoordData); sPainter.setTexCoordPointer(2, GL_FLOAT, texCoordData);
sPainter.setColorPointer(4, GL_FLOAT, colorArrayBolide.constData()); sPainter.setColorPointer(4, GL_FLOAT, colorArrayBolide.constData());
sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayBolide.constData( )); sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayBolide.constData( ));
sPainter.drawFromArray(StelPainter::TriangleFan, vertexArrayBolide.s ize(), 0, true); sPainter.drawFromArray(StelPainter::TriangleFan, vertexArrayBolide.s ize(), 0, true);
glDisable(GL_BLEND); sPainter.setBlending(false);
sPainter.enableClientStates(false); sPainter.enableClientStates(false);
} }
void Meteor::drawTrain(StelPainter& sPainter, const float& thickness) void Meteor::drawTrain(StelPainter& sPainter, const float& thickness)
{ {
if (m_segments != m_lineColorVector.size() || 2*m_segments != m_trai nColorVector.size()) if (m_segments != m_lineColorVector.size() || 2*m_segments != m_trai nColorVector.size())
{ {
qWarning() << "Meteor: color arrays have an inconsistent siz e!"; qWarning() << "Meteor: color arrays have an inconsistent siz e!";
return; return;
} }
skipping to change at line 470 skipping to change at line 471
posi[2] = height; posi[2] = height;
vertexArrayR.push_back(radiantToAltAz(posi)); vertexArrayR.push_back(radiantToAltAz(posi));
vertexArrayTop.push_back(radiantToAltAz(posi)); vertexArrayTop.push_back(radiantToAltAz(posi));
float mag = m_aptMag * ((float) i / (float) (m_segments-1)); float mag = m_aptMag * ((float) i / (float) (m_segments-1));
m_lineColorVector[i][3] = mag; m_lineColorVector[i][3] = mag;
m_trainColorVector[i*2][3] = mag; m_trainColorVector[i*2][3] = mag;
m_trainColorVector[i*2+1][3] = mag; m_trainColorVector[i*2+1][3] = mag;
} }
glEnable(GL_BLEND); sPainter.setBlending(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
sPainter.enableClientStates(true, false, true); sPainter.enableClientStates(true, false, true);
if (thickness) if (thickness)
{ {
sPainter.setColorPointer(4, GL_FLOAT, m_trainColorVector.con stData()); sPainter.setColorPointer(4, GL_FLOAT, m_trainColorVector.con stData());
sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayL.constDa ta()); sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayL.constDa ta());
sPainter.drawFromArray(StelPainter::TriangleStrip, vertexArr ayL.size(), 0, true); sPainter.drawFromArray(StelPainter::TriangleStrip, vertexArr ayL.size(), 0, true);
sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayR.constDa ta()); sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayR.constDa ta());
sPainter.drawFromArray(StelPainter::TriangleStrip, vertexArr ayR.size(), 0, true); sPainter.drawFromArray(StelPainter::TriangleStrip, vertexArr ayR.size(), 0, true);
sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayTop.const Data()); sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayTop.const Data());
sPainter.drawFromArray(StelPainter::TriangleStrip, vertexArr ayTop.size(), 0, true); sPainter.drawFromArray(StelPainter::TriangleStrip, vertexArr ayTop.size(), 0, true);
} }
sPainter.setColorPointer(4, GL_FLOAT, m_lineColorVector.constData()) ; sPainter.setColorPointer(4, GL_FLOAT, m_lineColorVector.constData()) ;
sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayLine.constData()) ; sPainter.setVertexPointer(3, GL_DOUBLE, vertexArrayLine.constData()) ;
sPainter.drawFromArray(StelPainter::LineStrip, vertexArrayLine.size( ), 0, true); sPainter.drawFromArray(StelPainter::LineStrip, vertexArrayLine.size( ), 0, true);
glDisable(GL_BLEND); sPainter.setBlending(false);
sPainter.enableClientStates(false); sPainter.enableClientStates(false);
} }
 End of changes. 5 change blocks. 
6 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/