SecurityCamera.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __GAME_SECURITYCAMERA_H__
  21. #define __GAME_SECURITYCAMERA_H__
  22. /*
  23. ===================================================================================
  24. Security camera
  25. ===================================================================================
  26. */
  27. class idSecurityCamera : public idEntity {
  28. public:
  29. CLASS_PROTOTYPE( idSecurityCamera );
  30. void Spawn( void );
  31. void Save( idSaveGame *savefile ) const;
  32. void Restore( idRestoreGame *savefile );
  33. virtual void Think( void );
  34. virtual renderView_t * GetRenderView();
  35. virtual void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
  36. virtual bool Pain( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
  37. virtual void Present( void );
  38. private:
  39. enum { SCANNING, LOSINGINTEREST, ALERT, ACTIVATED };
  40. float angle;
  41. float sweepAngle;
  42. int modelAxis;
  43. bool flipAxis;
  44. float scanDist;
  45. float scanFov;
  46. float sweepStart;
  47. float sweepEnd;
  48. bool negativeSweep;
  49. bool sweeping;
  50. int alertMode;
  51. float stopSweeping;
  52. float scanFovCos;
  53. idVec3 viewOffset;
  54. int pvsArea;
  55. idPhysics_RigidBody physicsObj;
  56. idTraceModel trm;
  57. void StartSweep( void );
  58. bool CanSeePlayer( void );
  59. void SetAlertMode( int status );
  60. void DrawFov( void );
  61. const idVec3 GetAxis( void ) const;
  62. float SweepSpeed( void ) const;
  63. void Event_ReverseSweep( void );
  64. void Event_ContinueSweep( void );
  65. void Event_Pause( void );
  66. void Event_Alert( void );
  67. void Event_AddLight( void );
  68. };
  69. #endif /* !__GAME_SECURITYCAMERA_H__ */