source-engine/game/shared/physics_saverestore.h

53 lines
1.7 KiB
C
Raw Normal View History

2023-10-03 14:23:56 +00:00
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
2020-04-22 16:56:21 +00:00
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef PHYSICS_SAVERESTORE_H
#define PHYSICS_SAVERESTORE_H
#if defined( _WIN32 )
#pragma once
#endif
#include "vphysics_interface.h"
class ISaveRestoreBlockHandler;
class IPhysicsObject;
class CPhysCollide;
//-----------------------------------------------------------------------------
ISaveRestoreBlockHandler *GetPhysSaveRestoreBlockHandler();
ISaveRestoreOps *GetPhysObjSaveRestoreOps( PhysInterfaceId_t );
//-------------------------------------
#define DEFINE_PHYSPTR(name) \
2023-10-26 14:07:53 +00:00
{ FIELD_CUSTOM, #name, {offsetof(classNameTypedef,name), 0}, 1, FTYPEDESC_SAVE, NULL, GetPhysObjSaveRestoreOps( GetPhysIID( &(((classNameTypedef *)0)->name) ) ), NULL }
2020-04-22 16:56:21 +00:00
#define DEFINE_PHYSPTR_ARRAY(name) \
2023-10-26 14:07:53 +00:00
{ FIELD_CUSTOM, #name, {offsetof(classNameTypedef,name), 0}, ARRAYSIZE(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, NULL, GetPhysObjSaveRestoreOps( GetPhysIID( &(((classNameTypedef *)0)->name[0]) ) ), NULL }
2020-04-22 16:56:21 +00:00
//-----------------------------------------------------------------------------
abstract_class IPhysSaveRestoreManager
{
public:
virtual void NoteBBox( const Vector &mins, const Vector &maxs, CPhysCollide * ) = 0;
virtual void AssociateModel( IPhysicsObject *, int modelIndex ) = 0;
virtual void AssociateModel( IPhysicsObject *, const CPhysCollide *pModel ) = 0;
virtual void ForgetModel( IPhysicsObject * ) = 0;
virtual void ForgetAllModels() = 0;
};
extern IPhysSaveRestoreManager *g_pPhysSaveRestoreManager;
//=============================================================================
#endif // PHYSICS_SAVERESTORE_H