.vector ivelocity1, ivelocity2;
.vector iforward1, iforward2;
.vector iup1, iup2;
+.vector ivforward1, ivforward2;
+.vector ivup1, ivup2;
.float itime1, itime2;
void InterpolateOrigin_Reset()
{
else
self.iflags |= IFLAG_PREVALID;
- self.iorigin1 = self.iorigin2;
- self.iorigin2 = self.origin;
+ if(self.iflags & IFLAG_ORIGIN)
+ {
+ self.iorigin1 = self.iorigin2;
+ self.iorigin2 = self.origin;
+ }
if(self.iflags & IFLAG_AUTOANGLES)
if(self.iorigin2 != self.iorigin1)
self.iup2 = v_up;
}
+ if(self.iflags & IFLAG_V_ANGLE)
+ {
+ fixedmakevectors(self.v_angle);
+ if(f0 & IFLAG_VALID)
+ {
+ self.ivforward1 = self.ivforward2;
+ self.ivup1 = self.ivup2;
+ }
+ else
+ {
+ self.ivforward1 = v_forward;
+ self.ivup1 = v_up;
+ }
+ self.ivforward2 = v_forward;
+ self.ivup2 = v_up;
+ }
+ else if(self.iflags & IFLAG_V_ANGLE_X)
+ {
+ self.ivforward1_x = self.ivforward2_x;
+ self.ivforward2_x = self.v_angle_x;
+ }
+
if(self.iflags & IFLAG_VELOCITY)
{
self.ivelocity1 = self.ivelocity2;
{
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_ORIGIN)
+ setorigin(self, (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_V_ANGLE)
+ {
+ forward = (1 - f) * self.ivforward1 + f * self.ivforward2;
+ up = (1 - f) * self.ivup1 + f * self.ivup2;
+ self.v_angle = fixedvectoangles2(forward, up);
+ }
+ else if(self.iflags & IFLAG_V_ANGLE_X)
+ self.v_angle_x = (1 - f) * self.ivforward1_x + f * self.ivforward2_x;
if(self.iflags & IFLAG_VELOCITY)
self.velocity = (1 - f) * self.ivelocity1 + f * self.ivelocity2;
}
}
void InterpolateOrigin_Undo()
{
- setorigin(self, self.iorigin2);
+ if(self.iflags & IFLAG_ORIGIN)
+ setorigin(self, self.iorigin2);
if(self.iflags & IFLAG_ANGLES)
self.angles = fixedvectoangles2(self.iforward2, self.iup2);
+ if(self.iflags & IFLAG_V_ANGLE)
+ self.v_angle = fixedvectoangles2(self.ivforward2, self.ivup2);
+ else if(self.iflags & IFLAG_V_ANGLE_X)
+ self.v_angle_x = self.ivforward2_x;
if(self.iflags & IFLAG_VELOCITY)
self.velocity = self.ivelocity2;
}