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.
96 lines
2.4 KiB
96 lines
2.4 KiB
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// |
|
// |
|
// Purpose: |
|
// |
|
// $NoKeywords: $ |
|
//=============================================================================// |
|
|
|
#ifndef C_ENVPROJECTED_TEXTURE_H |
|
#define C_ENVPROJECTED_TEXTURE_H |
|
#ifdef _WIN32 |
|
#pragma once |
|
#endif |
|
|
|
#include "c_baseentity.h" |
|
#include "basetypes.h" |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
// Purpose: |
|
//----------------------------------------------------------------------------- |
|
class C_EnvProjectedTexture : public C_BaseEntity |
|
{ |
|
DECLARE_CLASS( C_EnvProjectedTexture, C_BaseEntity ); |
|
public: |
|
DECLARE_CLIENTCLASS(); |
|
|
|
void SetMaterial( IMaterial *pMaterial ); |
|
void SetLightColor( byte r, byte g, byte b, byte a ); |
|
void SetSize( float flSize ); |
|
void SetRotation( float flRotation ); |
|
|
|
virtual void OnDataChanged( DataUpdateType_t updateType ); |
|
void ShutDownLightHandle( void ); |
|
|
|
virtual bool Simulate(); |
|
|
|
void UpdateLight( void ); |
|
|
|
C_EnvProjectedTexture(); |
|
~C_EnvProjectedTexture(); |
|
|
|
static void SetVisibleBBoxMinHeight( float flVisibleBBoxMinHeight ) { m_flVisibleBBoxMinHeight = flVisibleBBoxMinHeight; } |
|
static float GetVisibleBBoxMinHeight( void ) { return m_flVisibleBBoxMinHeight; } |
|
static C_EnvProjectedTexture *Create( ); |
|
|
|
private: |
|
|
|
inline bool IsBBoxVisible( void ); |
|
bool IsBBoxVisible( Vector vecExtentsMin, |
|
Vector vecExtentsMax ); |
|
|
|
ClientShadowHandle_t m_LightHandle; |
|
bool m_bForceUpdate; |
|
|
|
EHANDLE m_hTargetEntity; |
|
|
|
bool m_bState; |
|
bool m_bAlwaysUpdate; |
|
float m_flLightFOV; |
|
bool m_bEnableShadows; |
|
bool m_bSimpleProjection; |
|
bool m_bLightOnlyTarget; |
|
bool m_bLightWorld; |
|
bool m_bCameraSpace; |
|
float m_flBrightnessScale; |
|
color32 m_LightColor; |
|
Vector m_CurrentLinearFloatLightColor; |
|
float m_flCurrentLinearFloatLightAlpha; |
|
float m_flColorTransitionTime; |
|
float m_flAmbient; |
|
float m_flNearZ; |
|
float m_flFarZ; |
|
char m_SpotlightTextureName[ MAX_PATH ]; |
|
CTextureReference m_SpotlightTexture; |
|
int m_nSpotlightTextureFrame; |
|
int m_nShadowQuality; |
|
|
|
// simple projection |
|
IMaterial *m_pMaterial; |
|
float m_flProjectionSize; |
|
float m_flRotation; |
|
|
|
Vector m_vecExtentsMin; |
|
Vector m_vecExtentsMax; |
|
|
|
static float m_flVisibleBBoxMinHeight; |
|
}; |
|
|
|
|
|
|
|
bool C_EnvProjectedTexture::IsBBoxVisible( void ) |
|
{ |
|
return IsBBoxVisible( GetAbsOrigin() + m_vecExtentsMin, GetAbsOrigin() + m_vecExtentsMax ); |
|
} |
|
|
|
#endif // C_ENV_PROJECTED_TEXTURE_H
|
|
|