simple (but inefficent) traces added.
This commit is contained in:
parent
62e38d1d0b
commit
1a3fd63250
2 changed files with 31 additions and 0 deletions
|
@ -73,6 +73,8 @@ namespace endofthejedi {
|
||||||
renderShips();
|
renderShips();
|
||||||
renderMissiles();
|
renderMissiles();
|
||||||
|
|
||||||
|
renderTraces();
|
||||||
|
|
||||||
//glDisable(GL_DEPTH_TEST);
|
//glDisable(GL_DEPTH_TEST);
|
||||||
renderParticles();
|
renderParticles();
|
||||||
//glEnable(GL_DEPTH_TEST);
|
//glEnable(GL_DEPTH_TEST);
|
||||||
|
@ -244,4 +246,31 @@ namespace endofthejedi {
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RendererPolygon3d::renderTraces()
|
||||||
|
{
|
||||||
|
//std::vector<glm::vec2> points;
|
||||||
|
//points.push_back(glm::vec2(0.0, 0.0));
|
||||||
|
//points.push_back(glm::vec2(0.1, 0.02));
|
||||||
|
//points.push_back(glm::vec2(0.2, 0.05));
|
||||||
|
//points.push_back(glm::vec2(0.3, 0.1));
|
||||||
|
//points.push_back(glm::vec2(0.4, 0.2));
|
||||||
|
//points.push_back(glm::vec2(0.5, 0.4));
|
||||||
|
//points.push_back(glm::vec2(0.6, 0.8));
|
||||||
|
//points.push_back(glm::vec2(0.7, 1.0));
|
||||||
|
|
||||||
|
// revert to default
|
||||||
|
glUseProgram(0);
|
||||||
|
|
||||||
|
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||||
|
glColor3f(0.0, 0.0, 1.0);
|
||||||
|
|
||||||
|
for (const game::Trace *trace : m_state->traces) {
|
||||||
|
glBegin(GL_LINE_STRIP);
|
||||||
|
for (const game::Trace::TracePoint &tp : trace->points) {
|
||||||
|
glVertex2f(tp.position.x, tp.position.y);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,8 @@ namespace endofthejedi {
|
||||||
// do the actual computation with these values
|
// do the actual computation with these values
|
||||||
glm::mat4 computeModelMatrix(const glm::vec2 &pos, float scale, float angle=0.0);
|
glm::mat4 computeModelMatrix(const glm::vec2 &pos, float scale, float angle=0.0);
|
||||||
|
|
||||||
|
void renderTraces();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// all models are also here (for easy reloading etc.)
|
// all models are also here (for easy reloading etc.)
|
||||||
std::vector<PolygonModel*> m_models;
|
std::vector<PolygonModel*> m_models;
|
||||||
|
|
Loading…
Reference in a new issue