diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/trace.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/trace.h')
| -rw-r--r-- | mp/src/public/trace.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/mp/src/public/trace.h b/mp/src/public/trace.h new file mode 100644 index 00000000..50ddb8ce --- /dev/null +++ b/mp/src/public/trace.h @@ -0,0 +1,69 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+//
+//-----------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef TRACE_H
+#define TRACE_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "mathlib/mathlib.h"
+
+// Note: These flags need to match the bspfile.h DISPTRI_TAG_* flags.
+#define DISPSURF_FLAG_SURFACE (1<<0)
+#define DISPSURF_FLAG_WALKABLE (1<<1)
+#define DISPSURF_FLAG_BUILDABLE (1<<2)
+#define DISPSURF_FLAG_SURFPROP1 (1<<3)
+#define DISPSURF_FLAG_SURFPROP2 (1<<4)
+
+//=============================================================================
+// Base Trace Structure
+// - shared between engine/game dlls and tools (vrad)
+//=============================================================================
+
+class CBaseTrace
+{
+public:
+
+ // Displacement flags tests.
+ bool IsDispSurface( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFACE ) != 0 ); }
+ bool IsDispSurfaceWalkable( void ) { return ( ( dispFlags & DISPSURF_FLAG_WALKABLE ) != 0 ); }
+ bool IsDispSurfaceBuildable( void ) { return ( ( dispFlags & DISPSURF_FLAG_BUILDABLE ) != 0 ); }
+ bool IsDispSurfaceProp1( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP1 ) != 0 ); }
+ bool IsDispSurfaceProp2( void ) { return ( ( dispFlags & DISPSURF_FLAG_SURFPROP2 ) != 0 ); }
+
+public:
+
+ // these members are aligned!!
+ Vector startpos; // start position
+ Vector endpos; // final position
+ cplane_t plane; // surface normal at impact
+
+ float fraction; // time completed, 1.0 = didn't hit anything
+
+ int contents; // contents on other side of surface hit
+ unsigned short dispFlags; // displacement flags for marking surfaces with data
+
+ bool allsolid; // if true, plane is not valid
+ bool startsolid; // if true, the initial point was in a solid area
+
+ CBaseTrace() {}
+
+private:
+ // No copy constructors allowed
+ CBaseTrace(const CBaseTrace& vOther);
+};
+
+#endif // TRACE_H
|