Pyrogenesis trunk
Classes | Public Types | Public Member Functions | List of all members
ICmpObstructionManager Class Referenceabstract

Obstruction manager: provides efficient spatial queries over objects in the world. More...

#include <ICmpObstructionManager.h>

Inheritance diagram for ICmpObstructionManager:
Inheritance graph
[legend]
Collaboration diagram for ICmpObstructionManager:
Collaboration graph
[legend]

Classes

struct  ObstructionSquare
 Standard representation for all types of shapes, for use with geometry processing code. More...
 
struct  tag_t
 External identifiers for shapes. More...
 

Public Types

enum  EFlags {
  FLAG_BLOCK_MOVEMENT = (1 << 0) , FLAG_BLOCK_FOUNDATION = (1 << 1) , FLAG_BLOCK_CONSTRUCTION = (1 << 2) , FLAG_BLOCK_PATHFINDING = (1 << 3) ,
  FLAG_MOVING = (1 << 4) , FLAG_DELETE_UPON_CONSTRUCTION = (1 << 5)
}
 Boolean flags affecting the obstruction behaviour of a shape. More...
 
typedef u8 flags_t
 Bitmask of EFlag values. More...
 
- Public Types inherited from IComponent
using AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor)
 
using DeallocFunc = void(*)(IComponent *)
 

Public Member Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void SetUnitMovingFlag (tag_t tag, bool moving)=0
 Set whether a unit shape is moving or stationary. More...
 
virtual void SetUnitControlGroup (tag_t tag, entity_id_t group)=0
 Set the control group of a unit shape. More...
 
virtual void SetStaticControlGroup (tag_t tag, entity_id_t group, entity_id_t group2)=0
 Sets the control group of a static shape. More...
 
virtual void RemoveShape (tag_t tag)=0
 Remove an existing shape. More...
 
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 world. More...
 
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. More...
 
virtual fixed DistanceToTarget (entity_id_t ent, entity_id_t target) const =0
 Calculate the shortest distance between the entity and the target. More...
 
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. More...
 
virtual fixed DistanceBetweenShapes (const ObstructionSquare &source, const ObstructionSquare &target) const =0
 Calculate the shortest straight line distance between the source and the target. More...
 
virtual fixed MaxDistanceBetweenShapes (const ObstructionSquare &source, const ObstructionSquare &target) const =0
 Calculate the largest straight line distance between the source and the target. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 list of the colliding shapes' entities to an output list. More...
 
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 passClasses. More...
 
virtual void UpdateInformations (GridUpdateInformation &informations)=0
 Gets dirtiness information and resets it afterwards. More...
 
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. More...
 
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 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 void GetStaticObstructionsOnObstruction (const ObstructionSquare &square, std::vector< entity_id_t > &out, const IObstructionTestFilter &filter) const =0
 
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. More...
 
virtual ObstructionSquare GetObstruction (tag_t tag) const =0
 Get the obstruction square representing the given shape. More...
 
virtual ObstructionSquare GetUnitShapeObstruction (entity_pos_t x, entity_pos_t z, entity_pos_t clearance) const =0
 
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 void SetPassabilityCircular (bool enabled)=0
 Set the passability to be restricted to a circular map. More...
 
virtual bool GetPassabilityCircular () const =0
 
virtual void SetDebugOverlay (bool enabled)=0
 Toggle the rendering of debug info. More...
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
virtual void Init (const CParamNode &paramNode)=0
 
virtual void Deinit ()=0
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
CEntityHandle GetEntityHandle () const
 
void SetEntityHandle (CEntityHandle ent)
 
entity_id_t GetEntityId () const
 
CEntityHandle GetSystemEntity () const
 
const CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual void Serialize (ISerializer &serialize)=0
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)=0
 
virtual bool NewJSObject (const ScriptInterface &scriptInterface, JS::MutableHandleObject out) const
 Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More...
 
virtual JS::Value GetJSInstance () const
 
virtual int GetComponentTypeId () const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static void RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static void RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static u8 GetSerializationVersion ()
 

Detailed Description

Obstruction manager: provides efficient spatial queries over objects in the world.

The class deals with two types of shape: "static" shapes, typically representing buildings, which are rectangles with a given width and height and angle; and "unit" shapes, representing units that can move around the world, which have a radius and no rotation. (Units sometimes act as axis-aligned squares, sometimes as approximately circles, due to the algorithm used by the short pathfinder.)

Other classes (particularly ICmpObstruction) register shapes with this interface and keep them updated.

The Test functions provide exact collision tests. The edge of a shape counts as 'inside' the shape, for the purpose of collisions. The functions accept an IObstructionTestFilter argument, which can restrict the set of shapes that are counted as collisions.

Units can be marked as either moving or stationary, which simply determines whether certain filters include or exclude them.

The Rasterize function approximates the current set of shapes onto a 2D grid, for use with tile-based pathfinding.

Member Typedef Documentation

◆ flags_t

Bitmask of EFlag values.

Member Enumeration Documentation

◆ EFlags

Boolean flags affecting the obstruction behaviour of a shape.

Enumerator
FLAG_BLOCK_MOVEMENT 
FLAG_BLOCK_FOUNDATION 
FLAG_BLOCK_CONSTRUCTION 
FLAG_BLOCK_PATHFINDING 
FLAG_MOVING 
FLAG_DELETE_UPON_CONSTRUCTION 

Member Function Documentation

◆ AddStaticShape()

virtual tag_t ICmpObstructionManager::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 
)
pure virtual

Register a static shape.

Parameters
ententity ID associated with this shape (or INVALID_ENTITY if none)
x,zcoordinates of center, in world space
aangle of rotation (clockwise from +Z direction)
wwidth (size along X axis)
hheight (size along Z axis)
flagsa set of EFlags values
groupprimary control group of the shape. Must be a valid control group ID.
group2Optional; secondary control group of the shape. Defaults to INVALID_ENTITY.
Returns
a valid tag for manipulating the shape
See also
StaticShape

Implemented in CCmpObstructionManager.

◆ AddUnitShape()

virtual tag_t ICmpObstructionManager::AddUnitShape ( entity_id_t  ent,
entity_pos_t  x,
entity_pos_t  z,
entity_pos_t  clearance,
flags_t  flags,
entity_id_t  group 
)
pure virtual

Register a unit shape.

Parameters
ententity ID associated with this shape (or INVALID_ENTITY if none)
x,zcoordinates of center, in world space
clearancepathfinding clearance of the unit (works as a radius)
flagsa set of EFlags values
groupcontrol group (typically the owner entity, or a formation controller entity
  • units ignore collisions with others in the same group)
Returns
a valid tag for manipulating the shape
See also
UnitShape

Implemented in CCmpObstructionManager.

◆ AreShapesInRange()

virtual bool ICmpObstructionManager::AreShapesInRange ( const ObstructionSquare source,
const ObstructionSquare target,
entity_pos_t  minRange,
entity_pos_t  maxRange,
bool  opposite 
) const
pure virtual

Check if the given shape is in range of the target shape given those parameters.

Parameters
maxRange- Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE.

Implemented in CCmpObstructionManager.

◆ DistanceBetweenShapes()

virtual fixed ICmpObstructionManager::DistanceBetweenShapes ( const ObstructionSquare source,
const ObstructionSquare target 
) const
pure virtual

Calculate the shortest straight line distance between the source and the target.

Implemented in CCmpObstructionManager.

◆ DistanceToPoint()

virtual fixed ICmpObstructionManager::DistanceToPoint ( entity_id_t  ent,
entity_pos_t  px,
entity_pos_t  pz 
) const
pure virtual

Returns the distance from the obstruction to the point (px, pz), or -1 if the entity is out of the world.

Implemented in CCmpObstructionManager.

◆ DistanceToTarget()

virtual fixed ICmpObstructionManager::DistanceToTarget ( entity_id_t  ent,
entity_id_t  target 
) const
pure virtual

Calculate the shortest distance between the entity and the target.

Implemented in CCmpObstructionManager.

◆ GetObstruction()

virtual ObstructionSquare ICmpObstructionManager::GetObstruction ( tag_t  tag) const
pure virtual

Get the obstruction square representing the given shape.

Parameters
tagtag of shape (must be valid)

Implemented in CCmpObstructionManager.

◆ GetObstructionsInRange()

virtual void ICmpObstructionManager::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
pure virtual

Find all the obstructions that are inside (or partially inside) the given range.

Parameters
filterfilter to restrict the shapes that are counted
x0X coordinate of left edge of range
z0Z coordinate of bottom edge of range
x1X coordinate of right edge of range
z1Z coordinate of top edge of range
squaresoutput list of obstructions

Implemented in CCmpObstructionManager.

◆ GetPassabilityCircular()

virtual bool ICmpObstructionManager::GetPassabilityCircular ( ) const
pure virtual

Implemented in CCmpObstructionManager.

◆ GetStaticObstructionsInRange()

virtual void ICmpObstructionManager::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
pure virtual

Implemented in CCmpObstructionManager.

◆ GetStaticObstructionsOnObstruction()

virtual void ICmpObstructionManager::GetStaticObstructionsOnObstruction ( const ObstructionSquare square,
std::vector< entity_id_t > &  out,
const IObstructionTestFilter filter 
) const
pure virtual

Implemented in CCmpObstructionManager.

◆ GetStaticShapeObstruction()

virtual ObstructionSquare ICmpObstructionManager::GetStaticShapeObstruction ( entity_pos_t  x,
entity_pos_t  z,
entity_angle_t  a,
entity_pos_t  w,
entity_pos_t  h 
) const
pure virtual

Implemented in CCmpObstructionManager.

◆ GetUnitObstructionsInRange()

virtual void ICmpObstructionManager::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
pure virtual

Implemented in CCmpObstructionManager.

◆ GetUnitShapeObstruction()

virtual ObstructionSquare ICmpObstructionManager::GetUnitShapeObstruction ( entity_pos_t  x,
entity_pos_t  z,
entity_pos_t  clearance 
) const
pure virtual

Implemented in CCmpObstructionManager.

◆ GetUnitsOnObstruction()

virtual void ICmpObstructionManager::GetUnitsOnObstruction ( const ObstructionSquare square,
std::vector< entity_id_t > &  out,
const IObstructionTestFilter filter,
bool  strict = false 
) const
pure virtual

Returns the entity IDs of all unit shapes that intersect the given obstruction square, filtering out using the given filter.

Parameters
squarethe Obstruction squre we want to compare with.
outoutput list of obstructions
filterfilter for the obstructing units
strictwhether to be strict in the check or more permissive (ie rasterize more or less). Default false.

Implemented in CCmpObstructionManager.

◆ IsInPointRange()

virtual bool ICmpObstructionManager::IsInPointRange ( entity_id_t  ent,
entity_pos_t  px,
entity_pos_t  pz,
entity_pos_t  minRange,
entity_pos_t  maxRange,
bool  opposite 
) const
pure virtual

Check if the given entity is in range of the other point given those parameters.

Parameters
maxRange- Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE.

Implemented in CCmpObstructionManager.

◆ IsInTargetParabolicRange()

virtual bool ICmpObstructionManager::IsInTargetParabolicRange ( entity_id_t  ent,
entity_id_t  target,
entity_pos_t  minRange,
entity_pos_t  maxRange,
entity_pos_t  yOrigin,
bool  opposite 
) const
pure virtual

Check if the given entity is in parabolic range of the target given those parameters.

Parameters
maxRange- Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE.

Implemented in CCmpObstructionManager.

◆ IsInTargetRange()

virtual bool ICmpObstructionManager::IsInTargetRange ( entity_id_t  ent,
entity_id_t  target,
entity_pos_t  minRange,
entity_pos_t  maxRange,
bool  opposite 
) const
pure virtual

Check if the given entity is in range of the target given those parameters.

Parameters
maxRange- Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE.

Implemented in CCmpObstructionManager.

◆ IsPointInPointRange()

virtual bool ICmpObstructionManager::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
pure virtual

Check if the given point is in range of the other point given those parameters.

Parameters
maxRange- Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE.

Implemented in CCmpObstructionManager.

◆ MaxDistanceBetweenShapes()

virtual fixed ICmpObstructionManager::MaxDistanceBetweenShapes ( const ObstructionSquare source,
const ObstructionSquare target 
) const
pure virtual

Calculate the largest straight line distance between the source and the target.

Implemented in CCmpObstructionManager.

◆ MaxDistanceToPoint()

virtual fixed ICmpObstructionManager::MaxDistanceToPoint ( entity_id_t  ent,
entity_pos_t  px,
entity_pos_t  pz 
) const
pure virtual

Calculate the largest straight line distance between the entity and the point.

Implemented in CCmpObstructionManager.

◆ MaxDistanceToTarget()

virtual fixed ICmpObstructionManager::MaxDistanceToTarget ( entity_id_t  ent,
entity_id_t  target 
) const
pure virtual

Calculate the largest straight line distance between the entity and the target.

Implemented in CCmpObstructionManager.

◆ MoveShape()

virtual void ICmpObstructionManager::MoveShape ( tag_t  tag,
entity_pos_t  x,
entity_pos_t  z,
entity_angle_t  a 
)
pure virtual

Adjust the position and angle of an existing shape.

Parameters
tagtag of shape (must be valid)
xX coordinate of center, in world space
zZ coordinate of center, in world space
aangle of rotation (clockwise from +Z direction); ignored for unit shapes

Implemented in CCmpObstructionManager.

◆ Rasterize()

virtual void ICmpObstructionManager::Rasterize ( Grid< NavcellData > &  grid,
const std::vector< PathfinderPassability > &  passClasses,
bool  fullUpdate 
)
pure virtual

Convert the current set of shapes onto a navcell grid, for all passability classes contained in passClasses.

If fullUpdate is false, the function will only go through dirty shapes. Shapes are expanded by the passClasses clearances, by ORing their masks onto the grid.

Implemented in CCmpObstructionManager.

◆ RemoveShape()

virtual void ICmpObstructionManager::RemoveShape ( tag_t  tag)
pure virtual

Remove an existing shape.

The tag will be made invalid and must not be used after this.

Parameters
tagtag of shape (must be valid)

Implemented in CCmpObstructionManager.

◆ SetBounds()

virtual void ICmpObstructionManager::SetBounds ( entity_pos_t  x0,
entity_pos_t  z0,
entity_pos_t  x1,
entity_pos_t  z1 
)
pure virtual

Set the bounds of the world.

Any point outside the bounds is considered obstructed.

Parameters
x0,z0,x1,z1Coordinates of the corners of the world

Implemented in CCmpObstructionManager.

◆ SetDebugOverlay()

virtual void ICmpObstructionManager::SetDebugOverlay ( bool  enabled)
pure virtual

Toggle the rendering of debug info.

Implemented in CCmpObstructionManager.

◆ SetPassabilityCircular()

virtual void ICmpObstructionManager::SetPassabilityCircular ( bool  enabled)
pure virtual

Set the passability to be restricted to a circular map.

Implemented in CCmpObstructionManager.

◆ SetStaticControlGroup()

virtual void ICmpObstructionManager::SetStaticControlGroup ( tag_t  tag,
entity_id_t  group,
entity_id_t  group2 
)
pure virtual

Sets the control group of a static shape.

Parameters
tagTag of the shape to set the control group for. Must be a valid and static shape tag.
groupControl group entity ID.

Implemented in CCmpObstructionManager.

◆ SetUnitControlGroup()

virtual void ICmpObstructionManager::SetUnitControlGroup ( tag_t  tag,
entity_id_t  group 
)
pure virtual

Set the control group of a unit shape.

Parameters
tagtag of shape (must be valid and a unit shape)
groupcontrol group entity ID

Implemented in CCmpObstructionManager.

◆ SetUnitMovingFlag()

virtual void ICmpObstructionManager::SetUnitMovingFlag ( tag_t  tag,
bool  moving 
)
pure virtual

Set whether a unit shape is moving or stationary.

Parameters
tagtag of shape (must be valid and a unit shape)
movingwhether the unit is currently moving through the world or is stationary

Implemented in CCmpObstructionManager.

◆ TestLine()

virtual bool ICmpObstructionManager::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
pure virtual

Collision test a flat-ended thick line against the current set of shapes.

The line caps extend by r beyond the end points. Only intersections going from outside to inside a shape are counted.

Parameters
filterfilter to restrict the shapes that are counted
x0X coordinate of line's first point
z0Z coordinate of line's first point
x1X coordinate of line's second point
z1Z coordinate of line's second point
rradius (half width) of line
relaxClearanceForUnitswhether unit-unit collisions should be more permissive.
Returns
true if there is a collision

Implemented in CCmpObstructionManager.

◆ TestStaticShape()

virtual bool ICmpObstructionManager::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
pure virtual

Collision test a static square shape against the current set of shapes.

Parameters
filterfilter to restrict the shapes that are being tested against
xX coordinate of center
zZ coordinate of center
aangle of rotation (clockwise from +Z direction)
wwidth (size along X axis)
hheight (size along Z axis)
outif non-NULL, all colliding shapes' entities will be added to this list
Returns
true if there is a collision

Implemented in CCmpObstructionManager.

◆ TestUnitShape()

virtual bool ICmpObstructionManager::TestUnitShape ( const IObstructionTestFilter filter,
entity_pos_t  x,
entity_pos_t  z,
entity_pos_t  clearance,
std::vector< entity_id_t > *  out 
) const
pure virtual

Collision test a unit shape against the current set of registered shapes, and optionally writes a list of the colliding shapes' entities to an output list.

Parameters
filterfilter to restrict the shapes that are being tested against
xX coordinate of shape's center
zZ coordinate of shape's center
clearanceclearance of the shape's unit
outif non-NULL, all colliding shapes' entities will be added to this list
Returns
true if there is a collision

Implemented in CCmpObstructionManager.

◆ UpdateInformations()

virtual void ICmpObstructionManager::UpdateInformations ( GridUpdateInformation informations)
pure virtual

Gets dirtiness information and resets it afterwards.

Then it's the role of CCmpPathfinder to pass the information to other components if needed. (AIs, etc.) The return value is false if an update is unnecessary.

Implemented in CCmpObstructionManager.


The documentation for this class was generated from the following file: