59 float b =
missile.getCurrentBaseAlpha();
60 c = Misc.scaleAlpha(c, b);
61 undercolor = Misc.scaleAlpha(undercolor, b);
63 float baseDuration = 4f;
65 size =
missile.getSpec().getGlowRadius() * 0.5f;
67 Vector2f point =
new Vector2f(
missile.getLocation());
68 Vector2f pointOffset =
new Vector2f(
missile.getVelocity());
69 pointOffset.scale(0.1f);
70 Vector2f.add(point, pointOffset, point);
72 Vector2f vel =
new Vector2f();
74 for (
int i = 0; i < 1; i++) {
75 float dur = baseDuration + baseDuration * (float) Math.random();
79 Vector2f pt = Misc.getPointWithinRadius(point, nSize * 0.5f);
80 Vector2f v = Misc.getUnitVectorAtDegreeAngle((
float) Math.random() * 360f);
81 v.scale(nSize + nSize * (
float) Math.random() * 0.5f);
83 Vector2f.add(vel, v, v);
85 float maxSpeed = nSize * 1.5f * 0.2f;
86 float minSpeed = nSize * 1f * 0.2f;
87 float overMin = v.length() - minSpeed;
89 float durMult = 1f - overMin / (maxSpeed - minSpeed);
90 if (durMult < 0.1f) durMult = 0.1f;
91 dur *= 0.5f + 0.5f * durMult;
93 engine.addNegativeNebulaParticle(pt, v, nSize * 1f, 2f,
97 float dur = baseDuration;
101 for (
int i = 0; i < 2; i++) {
102 Vector2f loc =
new Vector2f(point);
103 loc = Misc.getPointWithinRadius(loc, size * 1f);
104 float s = size * 3f * (0.5f + (float) Math.random() * 0.5f);
105 engine.addNebulaParticle(loc, vel, s, 1.5f, rampUp, 0f, dur, c);