Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions | Variables
CCmpRangeManager.cpp File Reference
#include "precompiled.h"
#include "simulation2/system/Component.h"
#include "ICmpRangeManager.h"
#include "ICmpTerrain.h"
#include "simulation2/system/EntityMap.h"
#include "simulation2/MessageTypes.h"
#include "simulation2/components/ICmpPosition.h"
#include "simulation2/components/ICmpTerritoryManager.h"
#include "simulation2/components/ICmpVision.h"
#include "simulation2/components/ICmpWaterManager.h"
#include "simulation2/helpers/Render.h"
#include "simulation2/helpers/Spatial.h"
#include "graphics/Overlay.h"
#include "graphics/Terrain.h"
#include "lib/timer.h"
#include "maths/FixedVector2D.h"
#include "ps/CLogger.h"
#include "ps/Overlay.h"
#include "ps/Profile.h"
#include "renderer/Scene.h"
#include "lib/ps_stl.h"

Go to the source code of this file.

Classes

struct  Query
 Representation of a range query. More...
 
struct  EntityParabolicRangeOutline
 
struct  EntityData
 Representation of an entity, with the data needed for queries. More...
 
struct  SerializeQuery
 Serialization helper template for Query. More...
 
struct  SerializeEntityData
 Serialization helper template for EntityData. More...
 
struct  EntityDistanceOrdering
 Functor for sorting entities by distance from a source point. More...
 
class  CCmpRangeManager
 Range manager implementation. More...
 

Macros

#define DEBUG_RANGE_MANAGER_BOUNDS   0
 

Functions

static u32 CalcOwnerMask (player_id_t owner)
 Convert an owner ID (-1 = unowned, 0 = gaia, 1..30 = players) into a 32-bit mask for quick set-membership tests. More...
 
static u32 CalcPlayerLosMask (player_id_t player)
 Returns LOS mask for given player. More...
 
static u32 CalcSharedLosMask (std::vector< player_id_t > players)
 Returns shared LOS mask for given list of players. More...
 
static bool InParabolicRange (CFixedVector3D v, fixed range)
 Checks whether v is in a parabolic range of (0,0,0) The highest point of the paraboloid is (0,range/2,0) and the circle of distance 'range' around (0,0,0) on height y=0 is part of the paraboloid. More...
 
 cassert (sizeof(EntityData)==16)
 

Variables

static std::map< entity_id_t,
EntityParabolicRangeOutline
ParabolicRangesOutlines
 

Macro Definition Documentation

#define DEBUG_RANGE_MANAGER_BOUNDS   0

Definition at line 44 of file CCmpRangeManager.cpp.

Function Documentation

static u32 CalcOwnerMask ( player_id_t  owner)
inlinestatic

Convert an owner ID (-1 = unowned, 0 = gaia, 1..30 = players) into a 32-bit mask for quick set-membership tests.

Definition at line 67 of file CCmpRangeManager.cpp.

static u32 CalcPlayerLosMask ( player_id_t  player)
inlinestatic

Returns LOS mask for given player.

Definition at line 78 of file CCmpRangeManager.cpp.

static u32 CalcSharedLosMask ( std::vector< player_id_t players)
static

Returns shared LOS mask for given list of players.

Definition at line 88 of file CCmpRangeManager.cpp.

cassert ( sizeof(EntityData = =16)
static bool InParabolicRange ( CFixedVector3D  v,
fixed  range 
)
static

Checks whether v is in a parabolic range of (0,0,0) The highest point of the paraboloid is (0,range/2,0) and the circle of distance 'range' around (0,0,0) on height y=0 is part of the paraboloid.

Avoids sqrting and overflowing.

Definition at line 104 of file CCmpRangeManager.cpp.

Variable Documentation

std::map<entity_id_t, EntityParabolicRangeOutline> ParabolicRangesOutlines
static

Definition at line 132 of file CCmpRangeManager.cpp.