Team Fortress 2 Source Code as on 22/4/2020
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.

68 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VCOLLIDE_PARSE_H
  8. #define VCOLLIDE_PARSE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vphysics_interface.h"
  13. struct solid_t
  14. {
  15. int index;
  16. char name[512];
  17. char parent[512];
  18. char surfaceprop[512];
  19. Vector massCenterOverride;
  20. objectparams_t params;
  21. };
  22. struct fluid_t
  23. {
  24. int index;
  25. char surfaceprop[512];
  26. fluidparams_t params;
  27. fluid_t() {}
  28. fluid_t( fluid_t const& src ) : params(src.params)
  29. {
  30. index = src.index;
  31. }
  32. };
  33. //-----------------------------------------------------------------------------
  34. // Purpose: Pass this into the parser to handle the keys that vphysics does not
  35. // parse.
  36. //-----------------------------------------------------------------------------
  37. class IVPhysicsKeyHandler
  38. {
  39. public:
  40. virtual void ParseKeyValue( void *pData, const char *pKey, const char *pValue ) = 0;
  41. virtual void SetDefaults( void *pData ) = 0;
  42. };
  43. class IVPhysicsKeyParser
  44. {
  45. public:
  46. virtual ~IVPhysicsKeyParser() {}
  47. virtual const char *GetCurrentBlockName( void ) = 0;
  48. virtual bool Finished( void ) = 0;
  49. virtual void ParseSolid( solid_t *pSolid, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  50. virtual void ParseFluid( fluid_t *pFluid, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  51. virtual void ParseRagdollConstraint( constraint_ragdollparams_t *pConstraint, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  52. virtual void ParseSurfaceTable( int *table, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  53. virtual void ParseCustom( void *pCustom, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  54. virtual void ParseVehicle( vehicleparams_t *pVehicle, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  55. virtual void SkipBlock( void ) = 0;
  56. };
  57. #endif // VCOLLIDE_PARSE_H