adding nice trace-fadeout.
This commit is contained in:
parent
1a3fd63250
commit
b15cc1304d
5 changed files with 42 additions and 13 deletions
|
|
@ -263,9 +263,13 @@ namespace endofthejedi {
|
|||
glUseProgram(0);
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
glColor3f(0.0, 0.0, 1.0);
|
||||
|
||||
for (const game::Trace *trace : m_state->traces) {
|
||||
float fade_out = 1.0;
|
||||
if (trace->missile == nullptr) {
|
||||
fade_out = 1.0 - (trace->age / trace->maxAge);
|
||||
}
|
||||
|
||||
glColor3f(0.0, 0.3/fade_out, 1.0/fade_out);
|
||||
glBegin(GL_LINE_STRIP);
|
||||
for (const game::Trace::TracePoint &tp : trace->points) {
|
||||
glVertex2f(tp.position.x, tp.position.y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue