home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / sgqcver2 / camera.qc < prev    next >
Encoding:
Text File  |  1996-08-17  |  1.1 KB  |  31 lines

  1. float SVC_SETVIEWPORT = 5;    // Net.Protocol 0x05
  2. float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
  3. float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
  4.  
  5. void(entity me) CameraOn =
  6. {
  7.   local entity cam;
  8.   cam = hologram;  //Now you see why classnames are so important :)
  9.   msg_entity = me;                         // target of message
  10.   WriteByte (MSG_ONE, SVC_SETVIEWPORT);    // 5 = SVC_SETVIEWPORT;  
  11.   WriteEntity (MSG_ONE, cam);           // view port
  12.   WriteByte (MSG_ONE, SVC_SETVIEWANGLES);  // 10 = SVC_SETVIEWANGLES
  13.   WriteAngle(MSG_ONE, cam.angles_x);    // tilt 
  14.   WriteAngle(MSG_ONE, cam.angles_y);    // yaw
  15.   WriteAngle(MSG_ONE, cam.angles_z);    // flip
  16. };
  17.  
  18.  
  19. void(entity me) CameraOff =
  20. {
  21.   local entity cam;
  22.   cam = me;
  23.   msg_entity = me;                         // target of message
  24.   WriteByte (MSG_ONE, SVC_SETVIEWPORT);    // 5 = SVC_SETVIEWPORT;  
  25.   WriteEntity (MSG_ONE, cam);           // view port
  26.   WriteByte (MSG_ONE, SVC_SETVIEWANGLES);  // 10 = SVC_SETVIEWANGLES
  27.   WriteAngle(MSG_ONE, cam.angles_x);    // tilt 
  28.   WriteAngle(MSG_ONE, cam.angles_y);    // yaw
  29.   WriteAngle(MSG_ONE, cam.angles_z);    // flip
  30. };
  31.