mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-07 01:34:07 +00:00
3d:: better particles
This commit is contained in:
parent
cc98858aa0
commit
321a709f91
10
graph.cpp
10
graph.cpp
@ -5272,11 +5272,13 @@ struct flashdata {
|
|||||||
int size;
|
int size;
|
||||||
cell *where;
|
cell *where;
|
||||||
double angle;
|
double angle;
|
||||||
|
double angle2;
|
||||||
int spd; // 0 for flashes, >0 for particles
|
int spd; // 0 for flashes, >0 for particles
|
||||||
color_t color;
|
color_t color;
|
||||||
flashdata(int _t, int _s, cell *_w, color_t col, int sped) {
|
flashdata(int _t, int _s, cell *_w, color_t col, int sped) {
|
||||||
t=_t; size=_s; where=_w; color = col;
|
t=_t; size=_s; where=_w; color = col;
|
||||||
angle = rand() % 1000; spd = sped;
|
angle = rand() % 1000; spd = sped;
|
||||||
|
if(DIM == 3) angle2 = acos((rand() % 1000 - 499.5) / 500);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5550,9 +5552,13 @@ void drawFlashes() {
|
|||||||
if(f.spd) {
|
if(f.spd) {
|
||||||
#if CAP_SHAPES
|
#if CAP_SHAPES
|
||||||
kill = tim > 300;
|
kill = tim > 300;
|
||||||
int partcol = darkena(f.color, 0, max(255 - tim*255/300, 0));
|
int partcol = darkena(f.color, 0, DIM == 3 ? 255 : max(255 - tim*255/300, 0));
|
||||||
poly_outline = OUTLINE_DEFAULT;
|
poly_outline = OUTLINE_DEFAULT;
|
||||||
queuepoly(V * spin(f.angle) * xpush(f.spd * tim * scalefactor / 50000.), shParticle[f.size], partcol);
|
ld t = f.spd * tim * scalefactor / 50000.;
|
||||||
|
transmatrix T =
|
||||||
|
DIM == 2 ? V * spin(f.angle) * xpush(t) :
|
||||||
|
V * cspin(0, 1, f.angle) * cspin(0, 2, f.angle2) * cpush(2, t);
|
||||||
|
queuepoly(T, shParticle[f.size], partcol);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user