sqwarmed/sdk_src/game/client/c_breakableprop.cpp

52 lines
1.6 KiB
C++

//========= 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);
}
}