18 #ifndef INCLUDED_ICMPOBSTRUCTIONMANAGER 19 #define INCLUDED_ICMPOBSTRUCTIONMANAGER 64 bool valid()
const {
return n != 0; }
189 std::vector<entity_id_t>*
out)
const = 0;
205 std::vector<entity_id_t>*
out)
const = 0;
338 m_AvoidMoving(avoidMoving), m_Group(group)
343 if (group == m_Group || (group2 !=
INVALID_ENTITY && group2 == m_Group))
378 m_Exclude(exclude), m_Group(group1), m_Group2(group2), m_Mask(mask)
384 m_Exclude(false), m_Group(group1), m_Group2(group2), m_Mask(mask)
392 if (group == m_Group || group == m_Group2 || (group2 !=
INVALID_ENTITY &&
393 (group2 == m_Group || group2 == m_Group2)))
399 return (flags & m_Mask) == 0;
402 return (flags & m_Mask) != 0;
438 m_Tag(tag), m_Group(group1), m_Group2(group2), m_Mask(mask)
447 return (tag.
n != m_Tag.
n && (flags & m_Mask) != 0 && ((group == m_Group
448 && group2 == m_Group2) || (group2 == m_Group && group == m_Group2)));
465 return tag.
n != m_Tag.
n;
485 return (tag.n != m_Tag.n && (flags & m_Mask) != 0);
489 #endif // INCLUDED_ICMPOBSTRUCTIONMANAGER flags_t m_Mask
Definition: ICmpObstructionManager.h:477
Definition: IComponent.h:33
A simple fixed-point number class.
Definition: Fixed.h:115
Obstruction test filter that will test only against shapes that:
Definition: ICmpObstructionManager.h:429
Interface for ICmpObstructionManager Test functions to filter out unwanted shapes.
Definition: ICmpObstructionManager.h:282
Obstruction test filter that will test only against shapes that:
Definition: ICmpObstructionManager.h:369
u32 n
Definition: ICmpObstructionManager.h:66
tag_t()
Definition: ICmpObstructionManager.h:62
Definition: FixedVector2D.h:24
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Definition: code_annotation.h:38
virtual void SetUnitControlGroup(tag_t tag, entity_id_t group)=0
Set the control group of a unit shape.
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.
tag_t m_Tag
Definition: ICmpObstructionManager.h:457
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 UpdateInformations(GridUpdateInformation &informations)=0
Gets dirtiness information and resets it afterwards.
SkipTagObstructionFilter(tag_t tag)
Definition: ICmpObstructionManager.h:459
virtual void SetPassabilityCircular(bool enabled)=0
Set the passability to be restricted to a circular map.
virtual void Init(const CParamNode ¶mNode)=0
bool m_Exclude
Definition: ICmpObstructionManager.h:371
Obstruction test filter that reject shapes in a given control group, and rejects shapes that don't bl...
Definition: ICmpObstructionManager.h:331
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
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:419
ControlGroupMovementObstructionFilter(bool avoidMoving, entity_id_t group)
Definition: ICmpObstructionManager.h:337
Definition: ICmpObstructionManager.h:74
SkipControlGroupsRequireFlagObstructionFilter(entity_id_t group1, entity_id_t group2, flags_t mask)
Definition: ICmpObstructionManager.h:383
bool m_AvoidMoving
Definition: ICmpObstructionManager.h:333
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.
entity_id_t m_Group2
Definition: ICmpObstructionManager.h:433
tag_t(u32 n)
Definition: ICmpObstructionManager.h:63
entity_id_t m_Group
Definition: ICmpObstructionManager.h:432
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:483
Obstruction test filter that will test against all shapes.
Definition: ICmpObstructionManager.h:306
uint8_t u8
Definition: types.h:37
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 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...
entity_id_t m_Group2
Definition: ICmpObstructionManager.h:373
Obstruction test filter that will test only against stationary (i.e.
Definition: ICmpObstructionManager.h:318
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:321
tag_t m_Tag
Definition: ICmpObstructionManager.h:476
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 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, filtering out using the given filter.
flags_t m_Mask
Definition: ICmpObstructionManager.h:374
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:287
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.
uint32_t u32
Definition: types.h:39
entity_pos_t hw
Definition: ICmpObstructionManager.h:228
virtual void SetUnitMovingFlag(tag_t tag, bool moving)=0
Set whether a unit shape is moving or stationary.
SkipControlGroupsRequireFlagObstructionFilter(bool exclude, entity_id_t group1, entity_id_t group2, flags_t mask)
Definition: ICmpObstructionManager.h:377
virtual void SetStaticControlGroup(tag_t tag, entity_id_t group, entity_id_t group2)=0
Sets the control group of a static shape.
u8 flags_t
Bitmask of EFlag values.
Definition: ICmpObstructionManager.h:84
entity_id_t m_Group
Definition: ICmpObstructionManager.h:334
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:309
ICmpObstructionManager::flags_t flags_t
Definition: ICmpObstructionManager.h:286
entity_id_t m_Group
Definition: ICmpObstructionManager.h:372
#define DECLARE_INTERFACE_TYPE(iname)
Definition: Interface.h:23
virtual ~IObstructionTestFilter()
Definition: ICmpObstructionManager.h:288
Definition: ICmpObstructionManager.h:75
Definition: ICmpObstructionManager.h:77
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:341
Obstruction test filter that will test only against shapes that:
Definition: ICmpObstructionManager.h:474
virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t group, entity_id_t group2) const
Definition: ICmpObstructionManager.h:443
void Init()
Definition: ICmpObstructionManager.h:405
tag_t m_Tag
Definition: ICmpObstructionManager.h:431
Obstruction test filter that will test only against shapes that do not have the specified tag set...
Definition: ICmpObstructionManager.h:455
EFlags
Boolean flags affecting the obstruction behaviour of a shape.
Definition: ICmpObstructionManager.h:72
Definition: ICmpObstructionManager.h:78
ICmpObstructionManager::tag_t tag_t
Definition: ICmpObstructionManager.h:285
virtual bool GetPassabilityCircular() const =0
entity_pos_t z
Definition: ICmpObstructionManager.h:226
SkipTagRequireControlGroupsAndFlagObstructionFilter(tag_t tag, entity_id_t group1, entity_id_t group2, flags_t mask)
Definition: ICmpObstructionManager.h:437
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:463
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 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
const entity_id_t INVALID_ENTITY
Invalid entity ID.
Definition: Entity.h:35
u32 entity_id_t
Entity ID type.
Definition: Entity.h:23
SkipTagRequireFlagsObstructionFilter(tag_t tag, flags_t mask)
Definition: ICmpObstructionManager.h:479
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.
Standard representation for all types of shapes, for use with geometry processing code...
Definition: ICmpObstructionManager.h:224
virtual ObstructionSquare GetObstruction(tag_t tag) const =0
Get the obstruction square representing the given shape.
virtual void SetDebugOverlay(bool enabled)=0
Toggle the rendering of debug info.
Obstruction manager: provides efficient spatial queries over objects in the world.
Definition: ICmpObstructionManager.h:53
bool valid() const
Definition: ICmpObstructionManager.h:64
flags_t m_Mask
Definition: ICmpObstructionManager.h:434
External identifiers for shapes.
Definition: ICmpObstructionManager.h:60
CFixedVector2D v
Definition: ICmpObstructionManager.h:227
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 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:389
Definition: ICmpObstructionManager.h:76