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.

58 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef DEFORMATIONS_H
  7. #define DEFORMATIONS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tier0/platform.h"
  12. // nonlinear transformations which may be applied to model vertices when rendering. must be powers of two
  13. enum DeformationType_t
  14. {
  15. DEFORMATION_CLAMP_TO_BOX_IN_WORLDSPACE = 1, // minxyz.minsoftness / maxxyz.maxsoftness
  16. };
  17. struct DeformationBase_t // base class. don't use this
  18. {
  19. DeformationType_t m_eType;
  20. };
  21. struct BoxDeformation_t : DeformationBase_t
  22. {
  23. // don't change the layout without changing code in shaderapidx8!!!!
  24. Vector m_SourceMins; // cube to clamp within
  25. float m_flPad0;
  26. Vector m_SourceMaxes;
  27. float m_flPad1;
  28. Vector m_ClampMins;
  29. float m_flPad2;
  30. Vector m_ClampMaxes;
  31. float m_flPad3;
  32. FORCEINLINE BoxDeformation_t( void )
  33. {
  34. m_eType = DEFORMATION_CLAMP_TO_BOX_IN_WORLDSPACE;
  35. // invalid cube
  36. m_SourceMins.Init( 0,0,0 );
  37. m_SourceMaxes.Init( -1, -1, -1 );
  38. // no clamp
  39. m_ClampMins.Init( -FLT_MAX, -FLT_MAX, -FLT_MAX );
  40. m_ClampMaxes.Init( FLT_MAX, FLT_MAX, FLT_MAX );
  41. }
  42. };
  43. #endif