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.

43 lines
1.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // worldsize.h -- extent of world and resolution/size of coordinate messages used in engine
  9. #ifndef WORLDSIZE_H
  10. #define WORLDSIZE_H
  11. #pragma once
  12. // These definitions must match the coordinate message sizes in coordsize.h
  13. // Following values should be +16384, -16384, +15/16, -15/16
  14. // NOTE THAT IF THIS GOES ANY BIGGER THEN DISK NODES/LEAVES CANNOT USE SHORTS TO STORE THE BOUNDS
  15. #define MAX_COORD_INTEGER (16384)
  16. #define MIN_COORD_INTEGER (-MAX_COORD_INTEGER)
  17. #define MAX_COORD_FRACTION (1.0-(1.0/16.0))
  18. #define MIN_COORD_FRACTION (-1.0+(1.0/16.0))
  19. #define MAX_COORD_FLOAT (16384.0f)
  20. #define MIN_COORD_FLOAT (-MAX_COORD_FLOAT)
  21. // Width of the coord system, which is TOO BIG to send as a client/server coordinate value
  22. #define COORD_EXTENT (2*MAX_COORD_INTEGER)
  23. // Maximum traceable distance ( assumes cubic world and trace from one corner to opposite )
  24. // COORD_EXTENT * sqrt(3)
  25. #define MAX_TRACE_LENGTH ( 1.732050807569 * COORD_EXTENT )
  26. // This value is the LONGEST possible range (limited by max valid coordinate number, not 2x)
  27. #define MAX_COORD_RANGE (MAX_COORD_INTEGER)
  28. #define TEST_COORD( v ) (((v).x>=MIN_COORD_INTEGER*2) && ((v).x<=MAX_COORD_INTEGER*2) && \
  29. ((v).y>=MIN_COORD_INTEGER*2) && ((v).y<=MAX_COORD_INTEGER*2) && \
  30. ((v).z>=MIN_COORD_INTEGER*2) && ((v).z<=MAX_COORD_INTEGER*2))
  31. #define ASSERT_COORD( v ) Assert( TEST_COORD( v ) );
  32. #endif // WORLDSIZE_H