18#ifndef INCLUDED_ICMPOBSTRUCTIONMANAGER
19#define INCLUDED_ICMPOBSTRUCTIONMANAGER
81 bool valid()
const {
return n != 0; }
267 std::vector<entity_id_t>*
out)
const = 0;
283 std::vector<entity_id_t>*
out)
const = 0;
468 return (flags &
m_Mask) == 0;
471 return (flags &
m_Mask) != 0;
u16 NavcellData
Definition: ICmpObstructionManager.h:32
#define DECLARE_INTERFACE_TYPE(iname)
Definition: Interface.h:23
Definition: FixedVector2D.h:25
A simple fixed-point number class.
Definition: Fixed.h:120
Obstruction test filter that reject shapes in a given control group, and rejects shapes that don't bl...
Definition: ICmpObstructionManager.h:401
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:410
ControlGroupMovementObstructionFilter(bool avoidMoving, entity_id_t group)
Definition: ICmpObstructionManager.h:406
entity_id_t m_Group
Definition: ICmpObstructionManager.h:403
bool m_AvoidMoving
Definition: ICmpObstructionManager.h:402
Basic 2D array, intended for storing tile data, plus support for lazy updates by ICmpObstructionManag...
Definition: Grid.h:38
Obstruction manager: provides efficient spatial queries over objects in the world.
Definition: ICmpObstructionManager.h:61
virtual void SetDebugOverlay(bool enabled)=0
Toggle the rendering of debug info.
virtual bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const =0
Check if the given point is in range of the other point given those parameters.
virtual void GetStaticObstructionsInRange(const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector< ObstructionSquare > &squares) const =0
virtual void Rasterize(Grid< NavcellData > &grid, const std::vector< PathfinderPassability > &passClasses, bool fullUpdate)=0
Convert the current set of shapes onto a navcell grid, for all passability classes contained in passC...
EFlags
Boolean flags affecting the obstruction behaviour of a shape.
Definition: ICmpObstructionManager.h:90
@ FLAG_BLOCK_CONSTRUCTION
Definition: ICmpObstructionManager.h:93
@ FLAG_BLOCK_FOUNDATION
Definition: ICmpObstructionManager.h:92
@ FLAG_BLOCK_PATHFINDING
Definition: ICmpObstructionManager.h:94
@ FLAG_BLOCK_MOVEMENT
Definition: ICmpObstructionManager.h:91
@ FLAG_MOVING
Definition: ICmpObstructionManager.h:95
@ FLAG_DELETE_UPON_CONSTRUCTION
Definition: ICmpObstructionManager.h:96
u8 flags_t
Bitmask of EFlag values.
Definition: ICmpObstructionManager.h:102
virtual fixed DistanceToTarget(entity_id_t ent, entity_id_t target) const =0
Calculate the shortest distance between the entity and the target.
virtual bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const =0
Check if the given entity is in range of the target given those parameters.
virtual void RemoveShape(tag_t tag)=0
Remove an existing shape.
virtual ObstructionSquare GetUnitShapeObstruction(entity_pos_t x, entity_pos_t z, entity_pos_t clearance) const =0
virtual void GetObstructionsInRange(const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector< ObstructionSquare > &squares) const =0
Find all the obstructions that are inside (or partially inside) the given range.
virtual fixed MaxDistanceBetweenShapes(const ObstructionSquare &source, const ObstructionSquare &target) const =0
Calculate the largest straight line distance between the source and the target.
virtual void SetUnitMovingFlag(tag_t tag, bool moving)=0
Set whether a unit shape is moving or stationary.
virtual void MoveShape(tag_t tag, entity_pos_t x, entity_pos_t z, entity_angle_t a)=0
Adjust the position and angle of an existing shape.
virtual bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const =0
Check if the given entity is in range of the other point given those parameters.
virtual bool TestStaticShape(const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, std::vector< entity_id_t > *out) const =0
Collision test a static square shape against the current set of shapes.
virtual void SetPassabilityCircular(bool enabled)=0
Set the passability to be restricted to a circular map.
virtual void UpdateInformations(GridUpdateInformation &informations)=0
Gets dirtiness information and resets it afterwards.
virtual void GetUnitsOnObstruction(const ObstructionSquare &square, std::vector< entity_id_t > &out, const IObstructionTestFilter &filter, bool strict=false) const =0
Returns the entity IDs of all unit shapes that intersect the given obstruction square,...
virtual void SetStaticControlGroup(tag_t tag, entity_id_t group, entity_id_t group2)=0
Sets the control group of a static shape.
virtual ObstructionSquare GetObstruction(tag_t tag) const =0
Get the obstruction square representing the given shape.
virtual bool AreShapesInRange(const ObstructionSquare &source, const ObstructionSquare &target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const =0
Check if the given shape is in range of the target shape given those parameters.
virtual void GetUnitObstructionsInRange(const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector< ObstructionSquare > &squares) const =0
virtual tag_t AddUnitShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, flags_t flags, entity_id_t group)=0
Register a unit shape.
virtual tag_t AddStaticShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h, flags_t flags, entity_id_t group, entity_id_t group2=INVALID_ENTITY)=0
Register a static shape.
virtual bool TestLine(const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, bool relaxClearanceForUnits) const =0
Collision test a flat-ended thick line against the current set of shapes.
virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1)=0
Set the bounds of the world.
virtual void SetUnitControlGroup(tag_t tag, entity_id_t group)=0
Set the control group of a unit shape.
virtual bool IsInTargetParabolicRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, bool opposite) const =0
Check if the given entity is in parabolic range of the target given those parameters.
virtual fixed DistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const =0
Returns the distance from the obstruction to the point (px, pz), or -1 if the entity is out of the wo...
virtual fixed MaxDistanceToTarget(entity_id_t ent, entity_id_t target) const =0
Calculate the largest straight line distance between the entity and the target.
virtual bool TestUnitShape(const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, std::vector< entity_id_t > *out) const =0
Collision test a unit shape against the current set of registered shapes, and optionally writes a lis...
virtual fixed MaxDistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const =0
Calculate the largest straight line distance between the entity and the point.
virtual ObstructionSquare GetStaticShapeObstruction(entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h) const =0
virtual fixed DistanceBetweenShapes(const ObstructionSquare &source, const ObstructionSquare &target) const =0
Calculate the shortest straight line distance between the source and the target.
virtual void GetStaticObstructionsOnObstruction(const ObstructionSquare &square, std::vector< entity_id_t > &out, const IObstructionTestFilter &filter) const =0
virtual bool GetPassabilityCircular() const =0
Definition: IComponent.h:33
Interface for ICmpObstructionManager Test functions to filter out unwanted shapes.
Definition: ICmpObstructionManager.h:352
ICmpObstructionManager::tag_t tag_t
Definition: ICmpObstructionManager.h:354
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const =0
Return true if the shape with the specified parameters should be tested for collisions.
ICmpObstructionManager::flags_t flags_t
Definition: ICmpObstructionManager.h:355
virtual ~IObstructionTestFilter()
Definition: ICmpObstructionManager.h:357
Obstruction test filter that will test against all shapes.
Definition: ICmpObstructionManager.h:376
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:378
Definition: Pathfinding.h:214
Obstruction test filter that will test only against shapes that:
Definition: ICmpObstructionManager.h:439
void Init()
Definition: ICmpObstructionManager.h:474
bool m_Exclude
Definition: ICmpObstructionManager.h:440
SkipControlGroupsRequireFlagObstructionFilter(bool exclude, entity_id_t group1, entity_id_t group2, flags_t mask)
Definition: ICmpObstructionManager.h:446
flags_t m_Mask
Definition: ICmpObstructionManager.h:443
SkipControlGroupsRequireFlagObstructionFilter(entity_id_t group1, entity_id_t group2, flags_t mask)
Definition: ICmpObstructionManager.h:452
entity_id_t m_Group2
Definition: ICmpObstructionManager.h:442
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:458
entity_id_t m_Group
Definition: ICmpObstructionManager.h:441
Similar to ControlGroupMovementObstructionFilter, but also ignoring a specific tag.
Definition: ICmpObstructionManager.h:542
SkipTagAndControlGroupObstructionFilter(tag_t tag, bool avoidMoving, entity_id_t group)
Definition: ICmpObstructionManager.h:548
bool m_AvoidMoving
Definition: ICmpObstructionManager.h:545
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:552
tag_t m_Tag
Definition: ICmpObstructionManager.h:544
entity_id_t m_Group
Definition: ICmpObstructionManager.h:543
Obstruction test filter that will test only against shapes that do not have the specified tag set.
Definition: ICmpObstructionManager.h:525
SkipTagObstructionFilter(tag_t tag)
Definition: ICmpObstructionManager.h:528
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:532
tag_t m_Tag
Definition: ICmpObstructionManager.h:526
Obstruction test filter that will test only against shapes that:
Definition: ICmpObstructionManager.h:499
flags_t m_Mask
Definition: ICmpObstructionManager.h:503
entity_id_t m_Group2
Definition: ICmpObstructionManager.h:502
SkipTagRequireControlGroupsAndFlagObstructionFilter(tag_t tag, entity_id_t group1, entity_id_t group2, flags_t mask)
Definition: ICmpObstructionManager.h:506
entity_id_t m_Group
Definition: ICmpObstructionManager.h:501
tag_t m_Tag
Definition: ICmpObstructionManager.h:500
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:512
Obstruction test filter that will test only against shapes that:
Definition: ICmpObstructionManager.h:577
SkipTagRequireFlagsObstructionFilter(tag_t tag, flags_t mask)
Definition: ICmpObstructionManager.h:581
flags_t m_Mask
Definition: ICmpObstructionManager.h:579
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:585
tag_t m_Tag
Definition: ICmpObstructionManager.h:578
Obstruction test filter that will test only against stationary (i.e.
Definition: ICmpObstructionManager.h:388
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Return true if the shape with the specified parameters should be tested for collisions.
Definition: ICmpObstructionManager.h:390
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning.
Definition: code_annotation.h:40
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:277
const entity_id_t INVALID_ENTITY
Invalid entity ID.
Definition: Entity.h:35
u32 entity_id_t
Entity ID type.
Definition: Entity.h:29
Standard representation for all types of shapes, for use with geometry processing code.
Definition: ICmpObstructionManager.h:67
CFixedVector2D u
Definition: ICmpObstructionManager.h:69
entity_pos_t z
Definition: ICmpObstructionManager.h:68
entity_pos_t hw
Definition: ICmpObstructionManager.h:70
entity_pos_t hh
Definition: ICmpObstructionManager.h:70
entity_pos_t x
Definition: ICmpObstructionManager.h:68
CFixedVector2D v
Definition: ICmpObstructionManager.h:69
External identifiers for shapes.
Definition: ICmpObstructionManager.h:78
u32 n
Definition: ICmpObstructionManager.h:83
tag_t(u32 n)
Definition: ICmpObstructionManager.h:80
bool valid() const
Definition: ICmpObstructionManager.h:81
tag_t()
Definition: ICmpObstructionManager.h:79
uint8_t u8
Definition: types.h:37
uint16_t u16
Definition: types.h:38
uint32_t u32
Definition: types.h:39
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:407