self.draw = Draw_Snow;
}
-entity zcurve;
-void zcurveparticles(float effectnum, vector start, vector end, float end_dz, float speed, float depth)
-{
- // end_dz:
- // IF IT WERE A STRAIGHT LINE, it'd end end_dz above end
-
- vector mid;
- mid = (start + end) * 0.5;
-
- end_dz *= 0.25;
- mid_z += end_dz;
-
- --depth;
- if(depth < 0 || normalize(mid - start) * normalize(end - start) > 0.999999)
- // TODO make this a variable threshold
- // currently: 0.081 degrees
- // 0.99999 would be 0.256 degrees and is visible
- {
- zcurve.velocity = speed * normalize(end - start);
- trailparticles(zcurve, effectnum, start, end);
- }
- else
- {
- zcurveparticles(effectnum, start, mid, end_dz, speed, depth);
- zcurveparticles(effectnum, mid, end, end_dz, speed, depth);
- }
-}
-
-void Net_ReadZCurveParticles()
-{
- vector start, end;
- float end_dz;
- float effectnum, speed;
-
- if(!zcurve)
- {
- zcurve = spawn();
- zcurve.classname = "zcurve";
- }
-
- effectnum = ReadShort();
-
- start_x = ReadCoord();
- start_y = ReadCoord();
- start_z = ReadCoord();
-
- do
- {
- end_x = ReadCoord();
- end_y = ReadCoord();
- end_z = ReadCoord();
- end_dz = ReadCoord();
- speed = ReadShort();
- zcurveparticles(effectnum, start, end, end_dz, 16 * (speed & 0x7FFF), 5); // at most 32 segments
- }
- while(!(speed & 0x8000));
-}
-
void Net_ReadNexgunBeamParticle()
{
vector shotorg, endpos;