mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-07-18 23:31:22 +00:00
refactor(env_projectedtexture)!: Updated to the KS:GO version, still doesn't support anything because of `materialsystem`. refactor(fog_controller): Updated to the KS:GO version. chore(CBaseEntity): Remove the "Updating physics on object in hierarchy" warning.
101 lines
2.5 KiB
C++
101 lines
2.5 KiB
C++
//========= Copyright <20> 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 void Simulate();
|
||
|
||
bool ShouldUpdate( void );
|
||
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;
|
||
CMaterialReference m_ProjectedMaterial;
|
||
int m_nSpotlightTextureFrame;
|
||
int m_nShadowQuality;
|
||
int m_iStyle;
|
||
bool m_bIsCurrentlyProjected;
|
||
|
||
// 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
|