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/worldsize.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/worldsize.h')
| -rw-r--r-- | mp/src/public/worldsize.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mp/src/public/worldsize.h b/mp/src/public/worldsize.h new file mode 100644 index 00000000..b38100f8 --- /dev/null +++ b/mp/src/public/worldsize.h @@ -0,0 +1,42 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+// worldsize.h -- extent of world and resolution/size of coordinate messages used in engine
+
+#ifndef WORLDSIZE_H
+#define WORLDSIZE_H
+#pragma once
+
+
+// These definitions must match the coordinate message sizes in coordsize.h
+
+// Following values should be +16384, -16384, +15/16, -15/16
+// NOTE THAT IF THIS GOES ANY BIGGER THEN DISK NODES/LEAVES CANNOT USE SHORTS TO STORE THE BOUNDS
+#define MAX_COORD_INTEGER (16384)
+#define MIN_COORD_INTEGER (-MAX_COORD_INTEGER)
+#define MAX_COORD_FRACTION (1.0-(1.0/16.0))
+#define MIN_COORD_FRACTION (-1.0+(1.0/16.0))
+
+#define MAX_COORD_FLOAT (16384.0f)
+#define MIN_COORD_FLOAT (-MAX_COORD_FLOAT)
+
+// Width of the coord system, which is TOO BIG to send as a client/server coordinate value
+#define COORD_EXTENT (2*MAX_COORD_INTEGER)
+
+// Maximum traceable distance ( assumes cubic world and trace from one corner to opposite )
+// COORD_EXTENT * sqrt(3)
+#define MAX_TRACE_LENGTH ( 1.732050807569 * COORD_EXTENT )
+
+// This value is the LONGEST possible range (limited by max valid coordinate number, not 2x)
+#define MAX_COORD_RANGE (MAX_COORD_INTEGER)
+
+#define ASSERT_COORD( v ) Assert( (v.x>=MIN_COORD_INTEGER*2) && (v.x<=MAX_COORD_INTEGER*2) && \
+ (v.y>=MIN_COORD_INTEGER*2) && (v.y<=MAX_COORD_INTEGER*2) && \
+ (v.z>=MIN_COORD_INTEGER*2) && (v.z<=MAX_COORD_INTEGER*2) ); \
+
+
+#endif // WORLDSIZE_H
|