Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef C_ENVPROJECTED_TEXTURE_H
  8. #define C_ENVPROJECTED_TEXTURE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "c_baseentity.h"
  13. #include "basetypes.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose:
  16. //-----------------------------------------------------------------------------
  17. class C_EnvProjectedTexture : public C_BaseEntity
  18. {
  19. DECLARE_CLASS( C_EnvProjectedTexture, C_BaseEntity );
  20. public:
  21. DECLARE_CLIENTCLASS();
  22. void SetMaterial( IMaterial *pMaterial );
  23. void SetLightColor( byte r, byte g, byte b, byte a );
  24. void SetSize( float flSize );
  25. void SetRotation( float flRotation );
  26. virtual void OnDataChanged( DataUpdateType_t updateType );
  27. void ShutDownLightHandle( void );
  28. virtual bool Simulate();
  29. bool ShouldUpdate( void );
  30. void UpdateLight( void );
  31. C_EnvProjectedTexture();
  32. ~C_EnvProjectedTexture();
  33. static void SetVisibleBBoxMinHeight( float flVisibleBBoxMinHeight ) { m_flVisibleBBoxMinHeight = flVisibleBBoxMinHeight; }
  34. static float GetVisibleBBoxMinHeight( void ) { return m_flVisibleBBoxMinHeight; }
  35. static C_EnvProjectedTexture *Create( );
  36. private:
  37. inline bool IsBBoxVisible( void );
  38. bool IsBBoxVisible( Vector vecExtentsMin,
  39. Vector vecExtentsMax );
  40. ClientShadowHandle_t m_LightHandle;
  41. bool m_bForceUpdate;
  42. EHANDLE m_hTargetEntity;
  43. bool m_bState;
  44. bool m_bAlwaysUpdate;
  45. float m_flLightFOV;
  46. bool m_bEnableShadows;
  47. bool m_bSimpleProjection;
  48. bool m_bLightOnlyTarget;
  49. bool m_bLightWorld;
  50. bool m_bCameraSpace;
  51. float m_flBrightnessScale;
  52. color32 m_LightColor;
  53. Vector m_CurrentLinearFloatLightColor;
  54. float m_flCurrentLinearFloatLightAlpha;
  55. float m_flColorTransitionTime;
  56. float m_flAmbient;
  57. float m_flNearZ;
  58. float m_flFarZ;
  59. char m_SpotlightTextureName[ MAX_PATH ];
  60. CTextureReference m_SpotlightTexture;
  61. CMaterialReference m_ProjectedMaterial;
  62. int m_nSpotlightTextureFrame;
  63. int m_nShadowQuality;
  64. int m_iStyle;
  65. bool m_bIsCurrentlyProjected;
  66. // simple projection
  67. IMaterial *m_pMaterial;
  68. float m_flProjectionSize;
  69. float m_flRotation;
  70. Vector m_vecExtentsMin;
  71. Vector m_vecExtentsMax;
  72. static float m_flVisibleBBoxMinHeight;
  73. };
  74. bool C_EnvProjectedTexture::IsBBoxVisible( void )
  75. {
  76. return IsBBoxVisible( GetAbsOrigin() + m_vecExtentsMin, GetAbsOrigin() + m_vecExtentsMax );
  77. }
  78. #endif // C_ENV_PROJECTED_TEXTURE_H