Pyrogenesis
13997
|
Obstruction implementation. More...
Classes | |
struct | SerializeTag |
struct | Shape |
Public Types | |
enum | { STATIC, UNIT, CLUSTER } |
typedef ICmpObstructionManager::tag_t | tag_t |
typedef ICmpObstructionManager::flags_t | flags_t |
![]() | |
enum | EFoundationCheck { FOUNDATION_CHECK_SUCCESS, FOUNDATION_CHECK_FAIL_ERROR, FOUNDATION_CHECK_FAIL_NO_OBSTRUCTION, FOUNDATION_CHECK_FAIL_OBSTRUCTS_FOUNDATION, FOUNDATION_CHECK_FAIL_TERRAIN_CLASS } |
Public Member Functions | |
virtual void | Init (const CParamNode ¶mNode) |
virtual void | Deinit () |
template<typename S > | |
void | SerializeCommon (S &serialize) |
virtual void | Serialize (ISerializer &serialize) |
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) |
virtual void | HandleMessage (const CMessage &msg, bool global) |
virtual void | SetActive (bool active) |
virtual void | SetDisableBlockMovementPathfinding (bool movementDisabled, bool pathfindingDisabled, int32_t shape) |
virtual bool | GetBlockMovementFlag () |
virtual ICmpObstructionManager::tag_t | GetObstruction () |
virtual bool | GetObstructionSquare (ICmpObstructionManager::ObstructionSquare &out) |
Gets the square corresponding to this obstruction shape. More... | |
virtual entity_pos_t | GetUnitRadius () |
virtual bool | IsControlPersistent () |
virtual EFoundationCheck | CheckFoundation (std::string className) |
Test whether this entity is colliding with any obstruction that are set to block the creation of foundations. More... | |
virtual EFoundationCheck | CheckFoundation (std::string className, bool onlyCenterPoint) |
virtual bool | CheckDuplicateFoundation () |
Test whether this entity is colliding with any obstructions that share its control groups and block the creation of foundations. More... | |
virtual std::vector< entity_id_t > | GetEntityCollisions (bool checkStructures, bool checkUnits) |
Returns a list of entities that are colliding with this entity, filtered depending on type of entities that are requested. More... | |
virtual void | SetMovingFlag (bool enabled) |
virtual void | SetControlGroup (entity_id_t group) |
Change the control group that the entity belongs to. More... | |
virtual void | SetControlGroup2 (entity_id_t group2) |
virtual entity_id_t | GetControlGroup () |
See SetControlGroup. More... | |
virtual entity_id_t | GetControlGroup2 () |
void | UpdateControlGroups () |
void | ResolveFoundationCollisions () |
Detects collisions between foundation-blocking entities and tries to fix them by setting control groups, if appropriate. More... | |
![]() | |
virtual std::string | CheckFoundation_wrapper (std::string className, bool onlyCenterPoint) |
CheckFoundation wrapper for script calls, to return friendly strings instead of an EFoundationCheck. More... | |
![]() | |
virtual | ~IComponent () |
CEntityHandle | GetEntityHandle () const |
void | SetEntityHandle (CEntityHandle ent) |
entity_id_t | GetEntityId () const |
CEntityHandle | GetSystemEntity () const |
const CSimContext & | GetSimContext () const |
void | SetSimContext (const CSimContext &context) |
virtual JSClass * | GetJSClass () const |
virtual jsval | GetJSInstance () const |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (ScriptInterface &, jsval) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
![]() | |
static std::string | GetSchema () |
static u8 | GetSerializationVersion () |
Public Attributes | |
enum CCmpObstruction:: { ... } | m_Type |
entity_pos_t | m_Size0 |
entity_pos_t | m_Size1 |
flags_t | m_TemplateFlags |
std::vector< Shape > | m_Shapes |
bool | m_Active |
Whether the obstruction is actively obstructing or just an inactive placeholder. More... | |
bool | m_Moving |
Whether the entity associated with this obstruction is currently moving. More... | |
bool | m_ControlPersist |
Whether an obstruction's control group should be kept consistent and used to set control groups for entities that collide with it. More... | |
entity_id_t | m_ControlGroup |
Primary control group identifier. More... | |
entity_id_t | m_ControlGroup2 |
Optional secondary control group identifier. More... | |
tag_t | m_Tag |
Identifier of this entity's obstruction shape, as registered in the obstruction manager. More... | |
std::vector< tag_t > | m_ClusterTags |
flags_t | m_Flags |
Set of flags affecting the behaviour of this entity's obstruction shape. More... | |
Protected Member Functions | |
void | AddClusterShapes (entity_pos_t x, entity_pos_t z, entity_angle_t a) |
void | RemoveClusterShapes () |
Obstruction implementation.
This keeps the ICmpPathfinder's model of the world updated when the entities move and die, with shapes derived from ICmpFootprint.
Definition at line 36 of file CCmpObstruction.cpp.
Definition at line 48 of file CCmpObstruction.cpp.
Definition at line 47 of file CCmpObstruction.cpp.
anonymous enum |
Enumerator | |
---|---|
STATIC | |
UNIT | |
CLUSTER |
Definition at line 52 of file CCmpObstruction.cpp.
|
inlineprotected |
Definition at line 751 of file CCmpObstruction.cpp.
|
inlinestatic |
Definition at line 45 of file CCmpObstruction.cpp.
|
inlinevirtual |
Test whether this entity is colliding with any obstructions that share its control groups and block the creation of foundations.
Implements ICmpObstruction.
Definition at line 523 of file CCmpObstruction.cpp.
|
inlinevirtual |
Test whether this entity is colliding with any obstruction that are set to block the creation of foundations.
ignoredEntities | List of entities to ignore during the test. |
Implements ICmpObstruction.
Definition at line 481 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 486 of file CCmpObstruction.cpp.
|
inlinestatic |
Definition at line 39 of file CCmpObstruction.cpp.
|
inlinestatic |
Definition at line 45 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 243 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 274 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 435 of file CCmpObstruction.cpp.
|
inlinevirtual |
See SetControlGroup.
Implements ICmpObstruction.
Definition at line 641 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 646 of file CCmpObstruction.cpp.
|
inlinevirtual |
Returns a list of entities that are colliding with this entity, filtered depending on type of entities that are requested.
Implements ICmpObstruction.
Definition at line 555 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 440 of file CCmpObstruction.cpp.
|
inlinevirtual |
Gets the square corresponding to this obstruction shape.
out
on success; false on failure (e.g. object not in the world). Implements ICmpObstruction.
Definition at line 445 of file CCmpObstruction.cpp.
|
inlinestatic |
Definition at line 107 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 468 of file CCmpObstruction.cpp.
|
inlinevirtual |
Reimplemented from IComponent.
Definition at line 281 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 178 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 476 of file CCmpObstruction.cpp.
|
inlineprotected |
Definition at line 777 of file CCmpObstruction.cpp.
|
inlinevirtual |
Detects collisions between foundation-blocking entities and tries to fix them by setting control groups, if appropriate.
Implements ICmpObstruction.
Definition at line 678 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 269 of file CCmpObstruction.cpp.
|
inline |
Definition at line 257 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 353 of file CCmpObstruction.cpp.
|
inlinevirtual |
Change the control group that the entity belongs to.
Control groups are used to let units ignore collisions with other units from the same group. Default is the entity's own ID.
Implements ICmpObstruction.
Definition at line 629 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 635 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 405 of file CCmpObstruction.cpp.
|
inlinevirtual |
Implements ICmpObstruction.
Definition at line 617 of file CCmpObstruction.cpp.
|
inline |
Definition at line 651 of file CCmpObstruction.cpp.
bool CCmpObstruction::m_Active |
Whether the obstruction is actively obstructing or just an inactive placeholder.
Definition at line 74 of file CCmpObstruction.cpp.
std::vector<tag_t> CCmpObstruction::m_ClusterTags |
Definition at line 102 of file CCmpObstruction.cpp.
entity_id_t CCmpObstruction::m_ControlGroup |
Primary control group identifier.
Indicates to which control group this entity's shape belongs. Typically used in combination with obstruction test filters to have member shapes ignore each other during obstruction tests. Defaults to the entity's ID. Must never be set to INVALID_ENTITY.
Definition at line 87 of file CCmpObstruction.cpp.
entity_id_t CCmpObstruction::m_ControlGroup2 |
Optional secondary control group identifier.
Similar to m_ControlGroup; if set to a valid value, then this field identifies an additional, secondary control group to which this entity's shape belongs. Set to INVALID_ENTITY to not assign any secondary group. Defaults to INVALID_ENTITY.
These are only necessary in case it is not sufficient for an entity to belong to only one control group. Otherwise, they can be ignored.
Definition at line 97 of file CCmpObstruction.cpp.
bool CCmpObstruction::m_ControlPersist |
Whether an obstruction's control group should be kept consistent and used to set control groups for entities that collide with it.
Definition at line 80 of file CCmpObstruction.cpp.
flags_t CCmpObstruction::m_Flags |
Set of flags affecting the behaviour of this entity's obstruction shape.
Definition at line 105 of file CCmpObstruction.cpp.
bool CCmpObstruction::m_Moving |
Whether the entity associated with this obstruction is currently moving.
Only applicable for UNIT-type obstructions.
Definition at line 77 of file CCmpObstruction.cpp.
std::vector<Shape> CCmpObstruction::m_Shapes |
Definition at line 69 of file CCmpObstruction.cpp.
entity_pos_t CCmpObstruction::m_Size0 |
Definition at line 58 of file CCmpObstruction.cpp.
entity_pos_t CCmpObstruction::m_Size1 |
Definition at line 59 of file CCmpObstruction.cpp.
tag_t CCmpObstruction::m_Tag |
Identifier of this entity's obstruction shape, as registered in the obstruction manager.
Contains structure, but should be treated as opaque here.
Definition at line 101 of file CCmpObstruction.cpp.
flags_t CCmpObstruction::m_TemplateFlags |
Definition at line 60 of file CCmpObstruction.cpp.
enum { ... } CCmpObstruction::m_Type |