diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/physics_saverestore.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/physics_saverestore.h')
| -rw-r--r-- | game/shared/physics_saverestore.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/game/shared/physics_saverestore.h b/game/shared/physics_saverestore.h new file mode 100644 index 0000000..09e5d3e --- /dev/null +++ b/game/shared/physics_saverestore.h @@ -0,0 +1,52 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// 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) \ + { FIELD_CUSTOM, #name, { (int)offsetof(classNameTypedef,name), 0 }, 1, FTYPEDESC_SAVE, NULL, GetPhysObjSaveRestoreOps( GetPhysIID( &(((classNameTypedef *)0)->name) ) ), NULL } + +#define DEFINE_PHYSPTR_ARRAY(name) \ + { FIELD_CUSTOM, #name, { (int)offsetof(classNameTypedef,name), 0 }, ARRAYSIZE(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, NULL, GetPhysObjSaveRestoreOps( GetPhysIID( &(((classNameTypedef *)0)->name[0]) ) ), NULL } + +//----------------------------------------------------------------------------- + +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 |