r4193 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Aug 26 08:12:37 EDT 2008


Author: div0
Date: 2008-08-26 08:12:25 -0400 (Tue, 26 Aug 2008)
New Revision: 4193

Added:
   trunk/data/qcsrc/client/laser.qc
Log:
oops, forgot to commit


Added: trunk/data/qcsrc/client/laser.qc
===================================================================
--- trunk/data/qcsrc/client/laser.qc	                        (rev 0)
+++ trunk/data/qcsrc/client/laser.qc	2008-08-26 12:12:25 UTC (rev 4193)
@@ -0,0 +1,36 @@
+// a laser goes from origin in direction velocity
+// it has color 'colormod'
+// and stops when something is in the way
+.float cnt; // end effect
+.vector colormod;
+
+void Draw_Laser()
+{
+	traceline(self.origin, self.origin + self.velocity, 0, self);
+	Draw_CylindricLine(self.origin, trace_endpos, 4, "", 1, self.colormod, DRAWFLAG_ADDITIVE); // TODO make a texture to make the laser look smoother
+	pointparticles(self.cnt, trace_endpos, trace_plane_normal, 256 * drawframetime);
+}
+
+void Ent_Laser()
+{
+	float f;
+	// 30 bytes, or 13 bytes for just moving
+	f = ReadByte();
+	if(f & 1)
+	{
+		self.origin_x = ReadCoord();
+		self.origin_y = ReadCoord();
+		self.origin_z = ReadCoord();
+		self.colormod_x = ReadByte() / 255.0;
+		self.colormod_y = ReadByte() / 255.0;
+		self.colormod_z = ReadByte() / 255.0;
+		self.cnt = ReadShort(); // effect number
+	}
+	if(f & 2)
+	{
+		self.velocity_x = ReadCoord();
+		self.velocity_y = ReadCoord();
+		self.velocity_z = ReadCoord();
+	}
+	self.draw = Draw_Laser;
+}




More information about the nexuiz-commits mailing list