Counter Strike : Global Offensive Source Code
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.

91 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, 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. char name[512];
  16. char parent[512];
  17. char surfaceprop[512];
  18. Vector massCenterOverride;
  19. int index;
  20. int contents;
  21. objectparams_t params;
  22. };
  23. struct fluid_t
  24. {
  25. int index;
  26. char surfaceprop[512];
  27. fluidparams_t params;
  28. fluid_t() {}
  29. fluid_t( fluid_t const& src ) : params(src.params)
  30. {
  31. index = src.index;
  32. }
  33. };
  34. struct ragdollcollisionrules_t
  35. {
  36. void Defaults( IPhysics *pPhysics, IPhysicsCollisionSet *pSetIn )
  37. {
  38. pCollisionSet = pSetIn;
  39. bSelfCollisions = true;
  40. }
  41. int bSelfCollisions;
  42. IPhysicsCollisionSet *pCollisionSet;
  43. };
  44. struct ragdollanimatedfriction_t
  45. {
  46. float minFriction;
  47. float maxFriction;
  48. float timeIn;
  49. float timeOut;
  50. float timeHold;
  51. };
  52. //-----------------------------------------------------------------------------
  53. // Purpose: Pass this into the parser to handle the keys that vphysics does not
  54. // parse.
  55. //-----------------------------------------------------------------------------
  56. class IVPhysicsKeyHandler
  57. {
  58. public:
  59. virtual void ParseKeyValue( void *pData, const char *pKey, const char *pValue ) = 0;
  60. virtual void SetDefaults( void *pData ) = 0;
  61. };
  62. class IVPhysicsKeyParser
  63. {
  64. public:
  65. virtual ~IVPhysicsKeyParser() {}
  66. virtual const char *GetCurrentBlockName( void ) = 0;
  67. virtual bool Finished( void ) = 0;
  68. virtual void ParseSolid( solid_t *pSolid, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  69. virtual void ParseFluid( fluid_t *pFluid, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  70. virtual void ParseRagdollConstraint( constraint_ragdollparams_t *pConstraint, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  71. virtual void ParseSurfaceTable( int *table, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  72. virtual void ParseCustom( void *pCustom, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  73. virtual void ParseVehicle( vehicleparams_t *pVehicle, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  74. virtual void SkipBlock( void ) = 0;
  75. virtual void ParseCollisionRules( ragdollcollisionrules_t *pRules, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  76. virtual void ParseRagdollAnimatedFriction( ragdollanimatedfriction_t *pFriction, IVPhysicsKeyHandler *unknownKeyHandler ) = 0;
  77. };
  78. #endif // VCOLLIDE_PARSE_H