+++ /dev/null
-// FIXME make this generic code, to be used for other entities too?
-.vector iorigin1, iorigin2;
-.vector ivelocity1, ivelocity2;
-.vector iforward1, iforward2;
-.vector iup1, iup2;
-.float itime1, itime2;
-void InterpolateOrigin_Reset()
-{
- self.iflags &~= IFLAG_INTERNALMASK;
- self.itime1 = self.itime2 = 0;
-}
-void InterpolateOrigin_Note()
-{
- float dt;
- float f0;
-
- dt = time - self.itime2;
-
- f0 = self.iflags;
- if(self.iflags & IFLAG_PREVALID)
- self.iflags |= IFLAG_VALID;
- else
- self.iflags |= IFLAG_PREVALID;
-
- self.iorigin1 = self.iorigin2;
- self.iorigin2 = self.origin;
-
- if(self.iflags & IFLAG_AUTOANGLES)
- if(self.iorigin2 != self.iorigin1)
- self.angles = vectoangles(self.iorigin2 - self.iorigin1);
-
- if(self.iflags & IFLAG_ANGLES)
- {
- fixedmakevectors(self.angles);
- if(f0 & IFLAG_VALID)
- {
- self.iforward1 = self.iforward2;
- self.iup1 = self.iup2;
- }
- else
- {
- self.iforward1 = v_forward;
- self.iup1 = v_up;
- }
- self.iforward2 = v_forward;
- self.iup2 = v_up;
- }
-
- if(self.iflags & IFLAG_VELOCITY)
- {
- self.ivelocity1 = self.ivelocity2;
- self.ivelocity2 = self.velocity;
- }
-
- if(self.iflags & IFLAG_TELEPORTED)
- {
- self.iflags &~= IFLAG_TELEPORTED;
- self.itime1 = self.itime2 = time; // don't lerp
- }
- else if(vlen(self.iorigin2 - self.iorigin1) > 1000)
- {
- self.itime1 = self.itime2 = time; // don't lerp
- }
- else if((self.iflags & IFLAG_VELOCITY) && (vlen(self.ivelocity2 - self.ivelocity1) > 1000))
- {
- self.itime1 = self.itime2 = time; // don't lerp
- }
- else if(dt >= 0.2)
- {
- self.itime1 = self.itime2 = time;
- }
- else
- {
- self.itime1 = serverprevtime;
- self.itime2 = time;
- }
-}
-void InterpolateOrigin_Do()
-{
- vector forward, up;
- if(self.itime1 && self.itime2 && self.itime1 != self.itime2)
- {
- float f;
- f = bound(0, (time - self.itime1) / (self.itime2 - self.itime1), 1 + autocvar_cl_lerpexcess);
- self.origin = (1 - f) * self.iorigin1 + f * self.iorigin2;
- if(self.iflags & IFLAG_ANGLES)
- {
- forward = (1 - f) * self.iforward1 + f * self.iforward2;
- up = (1 - f) * self.iup1 + f * self.iup2;
- self.angles = fixedvectoangles2(forward, up);
- }
- if(self.iflags & IFLAG_VELOCITY)
- self.velocity = (1 - f) * self.ivelocity1 + f * self.ivelocity2;
- }
-}
-void InterpolateOrigin_Undo()
-{
- self.origin = self.iorigin2;
- if(self.iflags & IFLAG_ANGLES)
- self.angles = fixedvectoangles2(self.iforward2, self.iup2);
- if(self.iflags & IFLAG_VELOCITY)
- self.velocity = self.ivelocity2;
-}
-
+++ /dev/null
-.float iflags;
-#define IFLAG_VELOCITY 1
-#define IFLAG_ANGLES 2
-#define IFLAG_AUTOANGLES 4
-#define IFLAG_VALID 8
-#define IFLAG_PREVALID 16
-#define IFLAG_TELEPORTED 32
-#define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID)
-
-// call this BEFORE reading an entity update
-void InterpolateOrigin_Undo();
-
-// call this AFTER receiving an entity update
-void InterpolateOrigin_Note();
-
-// call this when the entity got teleported, before InterpolateOrigin_Note
-void InterpolateOrigin_Reset();
-
-// call this BEFORE drawing
-void InterpolateOrigin_Do();
autocvars.qh
-interpolate.qh
+../csqcmodel/interpolate.qh
teamradar.qh
hud.qh
scoreboard.qh
announcer.qc
Main.qc
View.qc
-interpolate.qc
+../csqcmodel/interpolate.qc
waypointsprites.qc
movetypes.qc
prandom.qc
--- /dev/null
+// FIXME make this generic code, to be used for other entities too?
+.vector iorigin1, iorigin2;
+.vector ivelocity1, ivelocity2;
+.vector iforward1, iforward2;
+.vector iup1, iup2;
+.float itime1, itime2;
+void InterpolateOrigin_Reset()
+{
+ self.iflags &~= IFLAG_INTERNALMASK;
+ self.itime1 = self.itime2 = 0;
+}
+void InterpolateOrigin_Note()
+{
+ float dt;
+ float f0;
+
+ dt = time - self.itime2;
+
+ f0 = self.iflags;
+ if(self.iflags & IFLAG_PREVALID)
+ self.iflags |= IFLAG_VALID;
+ else
+ self.iflags |= IFLAG_PREVALID;
+
+ self.iorigin1 = self.iorigin2;
+ self.iorigin2 = self.origin;
+
+ if(self.iflags & IFLAG_AUTOANGLES)
+ if(self.iorigin2 != self.iorigin1)
+ self.angles = vectoangles(self.iorigin2 - self.iorigin1);
+
+ if(self.iflags & IFLAG_ANGLES)
+ {
+ fixedmakevectors(self.angles);
+ if(f0 & IFLAG_VALID)
+ {
+ self.iforward1 = self.iforward2;
+ self.iup1 = self.iup2;
+ }
+ else
+ {
+ self.iforward1 = v_forward;
+ self.iup1 = v_up;
+ }
+ self.iforward2 = v_forward;
+ self.iup2 = v_up;
+ }
+
+ if(self.iflags & IFLAG_VELOCITY)
+ {
+ self.ivelocity1 = self.ivelocity2;
+ self.ivelocity2 = self.velocity;
+ }
+
+ if(self.iflags & IFLAG_TELEPORTED)
+ {
+ self.iflags &~= IFLAG_TELEPORTED;
+ self.itime1 = self.itime2 = time; // don't lerp
+ }
+ else if(vlen(self.iorigin2 - self.iorigin1) > 1000)
+ {
+ self.itime1 = self.itime2 = time; // don't lerp
+ }
+ else if((self.iflags & IFLAG_VELOCITY) && (vlen(self.ivelocity2 - self.ivelocity1) > 1000))
+ {
+ self.itime1 = self.itime2 = time; // don't lerp
+ }
+ else if(dt >= 0.2)
+ {
+ self.itime1 = self.itime2 = time;
+ }
+ else
+ {
+ self.itime1 = serverprevtime;
+ self.itime2 = time;
+ }
+}
+void InterpolateOrigin_Do()
+{
+ vector forward, up;
+ if(self.itime1 && self.itime2 && self.itime1 != self.itime2)
+ {
+ float f;
+ f = bound(0, (time - self.itime1) / (self.itime2 - self.itime1), 1 + autocvar_cl_lerpexcess);
+ self.origin = (1 - f) * self.iorigin1 + f * self.iorigin2;
+ if(self.iflags & IFLAG_ANGLES)
+ {
+ forward = (1 - f) * self.iforward1 + f * self.iforward2;
+ up = (1 - f) * self.iup1 + f * self.iup2;
+ self.angles = fixedvectoangles2(forward, up);
+ }
+ if(self.iflags & IFLAG_VELOCITY)
+ self.velocity = (1 - f) * self.ivelocity1 + f * self.ivelocity2;
+ }
+}
+void InterpolateOrigin_Undo()
+{
+ self.origin = self.iorigin2;
+ if(self.iflags & IFLAG_ANGLES)
+ self.angles = fixedvectoangles2(self.iforward2, self.iup2);
+ if(self.iflags & IFLAG_VELOCITY)
+ self.velocity = self.ivelocity2;
+}
+
--- /dev/null
+.float iflags;
+#define IFLAG_VELOCITY 1
+#define IFLAG_ANGLES 2
+#define IFLAG_AUTOANGLES 4
+#define IFLAG_VALID 8
+#define IFLAG_PREVALID 16
+#define IFLAG_TELEPORTED 32
+#define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID)
+
+// call this BEFORE reading an entity update
+void InterpolateOrigin_Undo();
+
+// call this AFTER receiving an entity update
+void InterpolateOrigin_Note();
+
+// call this when the entity got teleported, before InterpolateOrigin_Note
+void InterpolateOrigin_Reset();
+
+// call this BEFORE drawing
+void InterpolateOrigin_Do();