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.

69 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef TRACE_H
  14. #define TRACE_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #include "mathlib/mathlib.h"
  19. // Note: These flags need to match the bspfile.h DISPTRI_TAG_* flags.
  20. #define DISPSURF_FLAG_SURFACE (1<<0)
  21. #define DISPSURF_FLAG_WALKABLE (1<<1)
  22. #define DISPSURF_FLAG_BUILDABLE (1<<2)
  23. #define DISPSURF_FLAG_SURFPROP1 (1<<3)
  24. #define DISPSURF_FLAG_SURFPROP2 (1<<4)
  25. //=============================================================================
  26. // Base Trace Structure
  27. // - shared between engine/game dlls and tools (vrad)
  28. //=============================================================================
  29. class CBaseTrace
  30. {
  31. public:
  32. // Displacement flags tests.
  33. bool IsDispSurface( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFACE ) != 0 ); }
  34. bool IsDispSurfaceWalkable( void ) { return ( ( dispFlags & DISPSURF_FLAG_WALKABLE ) != 0 ); }
  35. bool IsDispSurfaceBuildable( void ) { return ( ( dispFlags & DISPSURF_FLAG_BUILDABLE ) != 0 ); }
  36. bool IsDispSurfaceProp1( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP1 ) != 0 ); }
  37. bool IsDispSurfaceProp2( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP2 ) != 0 ); }
  38. public:
  39. // these members are aligned!!
  40. Vector startpos; // start position
  41. Vector endpos; // final position
  42. cplane_t plane; // surface normal at impact
  43. float fraction; // time completed, 1.0 = didn't hit anything
  44. int contents; // contents on other side of surface hit
  45. unsigned short dispFlags; // displacement flags for marking surfaces with data
  46. bool allsolid; // if true, plane is not valid
  47. bool startsolid; // if true, the initial point was in a solid area
  48. CBaseTrace() {}
  49. private:
  50. // No copy constructors allowed
  51. CBaseTrace(const CBaseTrace& vOther);
  52. };
  53. #endif // TRACE_H