WarpZone_SetUp(self, self.enemy.oldorigin, self.enemy.avelocity, self.oldorigin, self.avelocity);
// engine currently wants this
- self.avelocity = AnglesTransform_TurnDirectionFR(self.avelocity);
self.drawmask = MASK_NORMAL;
// link me
setsize(self, self.mins, self.maxs);
}
-vector WarpZone_Camera_camera_transform(vector org, vector ang)
-{
- // a fixed camera view
- trace_endpos = self.oldorigin;
- makevectors(self.avelocity);
- return self.oldorigin;
-}
-
void WarpZone_Camera_Read(float isnew)
{
self.classname = "func_warpzone_camera";
self.avelocity_y = ReadCoord();
self.avelocity_z = ReadCoord();
+ // common stuff
+ WarpZone_Camera_SetUp(self, self.oldorigin, self.avelocity);
+
// engine currently wants this
self.drawmask = MASK_NORMAL;
- self.camera_transform = WarpZone_Camera_camera_transform;
// link me
//setmodel(self, self.model);
e.camera_transform = WarpZone_camera_transform;
}
+vector WarpZone_Camera_camera_transform(vector org, vector ang)
+{
+ // a fixed camera view
+ trace_endpos = self.warpzone_origin;
+ makevectors(self.warpzone_angles);
+ return self.warpzone_origin;
+}
+
+void WarpZone_Camera_SetUp(entity e, vector my_org, vector my_ang) // we assume that e.oldorigin and e.avelocity point to view origin and direction
+{
+ e.warpzone_origin = my_org;
+ e.warpzone_angles = my_ang;
+ e.camera_transform = WarpZone_Camera_camera_transform;
+}
+
.entity enemy;
vector WarpZoneLib_BoxTouchesBrush_mins;
error("Camera with nonexisting target");
return;
}
+ WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
}
void WarpZone_InitStep_UpdateTransform()