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.

73 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, 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. #define DISPSURF_FLAG_SURFPROP3 (1<<5)
  26. #define DISPSURF_FLAG_SURFPROP4 (1<<6)
  27. //=============================================================================
  28. // Base Trace Structure
  29. // - shared between engine/game dlls and tools (vrad)
  30. //=============================================================================
  31. class CBaseTrace
  32. {
  33. public:
  34. // Displacement flags tests.
  35. bool IsDispSurface( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFACE ) != 0 ); }
  36. bool IsDispSurfaceWalkable( void ) { return ( ( dispFlags & DISPSURF_FLAG_WALKABLE ) != 0 ); }
  37. bool IsDispSurfaceBuildable( void ) { return ( ( dispFlags & DISPSURF_FLAG_BUILDABLE ) != 0 ); }
  38. bool IsDispSurfaceProp1( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP1 ) != 0 ); }
  39. bool IsDispSurfaceProp2( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP2 ) != 0 ); }
  40. bool IsDispSurfaceProp3( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP3 ) != 0 ); }
  41. bool IsDispSurfaceProp4( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP4 ) != 0 ); }
  42. public:
  43. // these members are aligned!!
  44. Vector startpos; // start position
  45. Vector endpos; // final position
  46. cplane_t plane; // surface normal at impact
  47. float fraction; // time completed, 1.0 = didn't hit anything
  48. int contents; // contents on other side of surface hit
  49. unsigned short dispFlags; // displacement flags for marking surfaces with data
  50. bool allsolid; // if true, plane is not valid
  51. bool startsolid; // if true, the initial point was in a solid area
  52. CBaseTrace() {}
  53. private:
  54. // No copy constructors allowed
  55. CBaseTrace(const CBaseTrace& vOther);
  56. };
  57. #endif // TRACE_H