Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions
CCmpObstructionManager.cpp File Reference
#include "precompiled.h"
#include "simulation2/system/Component.h"
#include "ICmpObstructionManager.h"
#include "simulation2/MessageTypes.h"
#include "simulation2/helpers/Geometry.h"
#include "simulation2/helpers/Render.h"
#include "simulation2/helpers/Spatial.h"
#include "simulation2/serialization/SerializeTemplates.h"
#include "graphics/Overlay.h"
#include "graphics/Terrain.h"
#include "maths/MathUtil.h"
#include "ps/Overlay.h"
#include "ps/Profile.h"
#include "renderer/Scene.h"
#include "ps/CLogger.h"

Go to the source code of this file.

Classes

struct  UnitShape
 Internal representation of axis-aligned sometimes-square sometimes-circle shapes for moving units. More...
 
struct  StaticShape
 Internal representation of arbitrary-rotation static square shapes for buildings. More...
 
struct  SerializeUnitShape
 Serialization helper template for UnitShape. More...
 
struct  SerializeStaticShape
 Serialization helper template for StaticShape. More...
 
class  CCmpObstructionManager
 

Macros

#define TAG_IS_VALID(tag)   ((tag).valid())
 
#define TAG_IS_UNIT(tag)   (((tag).n & 1) == 0)
 
#define TAG_IS_STATIC(tag)   (((tag).n & 1) == 1)
 
#define UNIT_INDEX_TO_TAG(idx)   tag_t(((idx) << 1) | 0)
 
#define STATIC_INDEX_TO_TAG(idx)   tag_t(((idx) << 1) | 1)
 
#define TAG_TO_INDEX(tag)   ((tag).n >> 1)
 

Functions

static void NearestTile (entity_pos_t x, entity_pos_t z, u16 &i, u16 &j, u16 w, u16 h)
 Compute the tile indexes on the grid nearest to a given point. More...
 
static void TileCenter (u16 i, u16 j, entity_pos_t &x, entity_pos_t &z)
 Returns the position of the center of the given tile. More...
 

Macro Definition Documentation

#define STATIC_INDEX_TO_TAG (   idx)    tag_t(((idx) << 1) | 1)

Definition at line 44 of file CCmpObstructionManager.cpp.

#define TAG_IS_STATIC (   tag)    (((tag).n & 1) == 1)

Definition at line 42 of file CCmpObstructionManager.cpp.

#define TAG_IS_UNIT (   tag)    (((tag).n & 1) == 0)

Definition at line 41 of file CCmpObstructionManager.cpp.

#define TAG_IS_VALID (   tag)    ((tag).valid())

Definition at line 40 of file CCmpObstructionManager.cpp.

#define TAG_TO_INDEX (   tag)    ((tag).n >> 1)

Definition at line 45 of file CCmpObstructionManager.cpp.

#define UNIT_INDEX_TO_TAG (   idx)    tag_t(((idx) << 1) | 0)

Definition at line 43 of file CCmpObstructionManager.cpp.

Function Documentation

static void NearestTile ( entity_pos_t  x,
entity_pos_t  z,
u16 i,
u16 j,
u16  w,
u16  h 
)
static

Compute the tile indexes on the grid nearest to a given point.

Definition at line 710 of file CCmpObstructionManager.cpp.

static void TileCenter ( u16  i,
u16  j,
entity_pos_t x,
entity_pos_t z 
)
static

Returns the position of the center of the given tile.

Definition at line 719 of file CCmpObstructionManager.cpp.