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.
51 lines
1.5 KiB
51 lines
1.5 KiB
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// |
|
// |
|
// Purpose: |
|
// |
|
//=============================================================================// |
|
#include "cbase.h" |
|
#include "model_types.h" |
|
#include "vcollide.h" |
|
#include "vcollide_parse.h" |
|
#include "solidsetdefaults.h" |
|
#include "bone_setup.h" |
|
#include "engine/ivmodelinfo.h" |
|
#include "physics.h" |
|
#include "c_breakableprop.h" |
|
#include "view.h" |
|
|
|
// memdbgon must be the last include file in a .cpp file!!! |
|
#include "tier0/memdbgon.h" |
|
|
|
IMPLEMENT_CLIENTCLASS_DT(C_BreakableProp, DT_BreakableProp, CBreakableProp) |
|
RecvPropBool( RECVINFO( m_bClientPhysics ) ), |
|
END_RECV_TABLE() |
|
|
|
//----------------------------------------------------------------------------- |
|
// Purpose: |
|
//----------------------------------------------------------------------------- |
|
C_BreakableProp::C_BreakableProp( void ) |
|
{ |
|
m_takedamage = DAMAGE_YES; |
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
// Copy fade from another breakable prop |
|
//----------------------------------------------------------------------------- |
|
void C_BreakableProp::CopyFadeFrom( C_BreakableProp *pSource ) |
|
{ |
|
SetGlobalFadeScale( pSource->GetGlobalFadeScale() ); |
|
SetDistanceFade( pSource->GetMinFadeDist(), pSource->GetMaxFadeDist() ); |
|
} |
|
|
|
void C_BreakableProp::OnDataChanged( DataUpdateType_t type ) |
|
{ |
|
BaseClass::OnDataChanged( type ); |
|
if ( m_bClientPhysics ) |
|
{ |
|
bool bCreate = (type == DATA_UPDATE_CREATED) ? true : false; |
|
VPhysicsShadowDataChanged(bCreate, this); |
|
} |
|
} |
|
|
|
|