Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CCmpUnitMotion_System.cpp File Reference
#include "precompiled.h"
#include "CCmpUnitMotion.h"
#include "CCmpUnitMotionManager.h"
#include "maths/MathUtil.h"
#include "ps/CLogger.h"
#include "ps/Profile.h"
#include <algorithm>
#include <limits>
#include <unordered_set>
#include <vector>
Include dependency graph for CCmpUnitMotion_System.cpp:

Classes

struct  SerializeHelper< CCmpUnitMotionManager::MotionState >
 
struct  SerializeHelper< EntityMap< CCmpUnitMotionManager::MotionState > >
 

Namespaces

namespace  anonymous_namespace{CCmpUnitMotion_System.cpp}
 

Macros

#define DEBUG_STATS   0
 
#define DEBUG_RENDER   0
 
#define DEBUG_RENDER_ALL_PUSH   0
 

Variables

constexpr int anonymous_namespace{CCmpUnitMotion_System.cpp}::PUSHING_GRID_SIZE = 20
 Units push within their square and neighboring squares (except diagonals). More...
 
constexpr entity_pos_t anonymous_namespace{CCmpUnitMotion_System.cpp}::PUSHING_CORRECTION = entity_pos_t::FromFraction(5, 7)
 For pushing, treat the clearances as a circle - they're defined as squares, so we'll take the circumscribing square (approximately). More...
 
constexpr int anonymous_namespace{CCmpUnitMotion_System.cpp}::PUSHING_REDUCTION_FACTOR = 2
 Arbitrary constant used to reduce pushing to levels that won't break physics for our turn length. More...
 
constexpr entity_pos_t anonymous_namespace{CCmpUnitMotion_System.cpp}::MAX_DISTANCE_FACTOR = entity_pos_t::FromFraction(5, 2)
 Maximum distance-related multiplier. More...
 
constexpr int anonymous_namespace{CCmpUnitMotion_System.cpp}::MAX_PUSHING_MULTIPLIER = 4
 Maximum pushing multiplier for a single push calculation. More...
 
constexpr entity_pos_t anonymous_namespace{CCmpUnitMotion_System.cpp}::PERPENDICULAR_NUDGE_THRESHOLD = entity_pos_t::FromFraction(-1, 10)
 When two units collide, if their movement dot product is below this value, give them a perpendicular nudge instead of trying to push in the regular way. More...
 
constexpr int anonymous_namespace{CCmpUnitMotion_System.cpp}::MAX_PUSH_DAMPING_PRESSURE = 160
 Pushing is dampened by pushing pressure, but this is capped so that units still get pushed. More...
 
constexpr int anonymous_namespace{CCmpUnitMotion_System.cpp}::MIN_PRESSURE_IF_OBSTRUCTED = 80
 When units are obstructed because they're being pushed away from where they want to go, raise the pushing pressure to at least this value. More...
 
constexpr entity_pos_t anonymous_namespace{CCmpUnitMotion_System.cpp}::PRESSURE_STATIC_FACTOR = entity_pos_t::FromInt(2)
 These two numbers are used to calculate pushing pressure between two units. More...
 
constexpr int anonymous_namespace{CCmpUnitMotion_System.cpp}::PRESSURE_DISTANCE_FACTOR = 5
 

Macro Definition Documentation

◆ DEBUG_RENDER

#define DEBUG_RENDER   0

◆ DEBUG_RENDER_ALL_PUSH

#define DEBUG_RENDER_ALL_PUSH   0

◆ DEBUG_STATS

#define DEBUG_STATS   0