Pyrogenesis
13997
|
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 bool | IsMoving () |
Get whether the unit is moving. More... | |
virtual fixed | GetWalkSpeed () |
Get the default speed that this unit will have when walking, in metres per second. More... | |
virtual fixed | GetRunSpeed () |
Get the default speed that this unit will have when running, in metres per second. More... | |
virtual ICmpPathfinder::pass_class_t | GetPassabilityClass () |
Get the unit's passability class. More... | |
virtual fixed | GetCurrentSpeed () |
Get the current movement speed. More... | |
virtual void | SetSpeed (fixed speed) |
Set the current movement speed. More... | |
virtual void | SetFacePointAfterMove (bool facePointAfterMove) |
Set whether the unit will turn to face the target point after finishing moving. More... | |
virtual void | SetDebugOverlay (bool enabled) |
Toggle the rendering of debug info. More... | |
virtual bool | MoveToPointRange (entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) |
Attempt to walk into range of a to a given point, or as close as possible. More... | |
virtual bool | IsInPointRange (entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) |
Determine wether the givven point is within the given range, using the same measurement as MoveToPointRange. More... | |
virtual bool | MoveToTargetRange (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) |
Attempt to walk into range of a given target entity, or as close as possible. More... | |
virtual bool | IsInTargetRange (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) |
Determine whether the target is within the given range, using the same measurement as MoveToTargetRange. More... | |
virtual void | MoveToFormationOffset (entity_id_t target, entity_pos_t x, entity_pos_t z) |
Join a formation, and move towards a given offset relative to the formation controller entity. More... | |
virtual void | FaceTowardsPoint (entity_pos_t x, entity_pos_t z) |
Turn to look towards the given point. More... | |
virtual void | StopMoving () |
Stop moving immediately. More... | |
virtual void | SetUnitRadius (fixed radius) |
Override the default obstruction radius, used for planning paths and checking for collisions. 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 () |
Private Member Functions | |
bool | ShouldAvoidMovingUnits () |
bool | IsFormationMember () |
void | StartFailed () |
void | MoveFailed () |
void | StartSucceeded () |
void | MoveSucceeded () |
void | PathResult (u32 ticket, const ICmpPathfinder::Path &path) |
Handle the result of an asynchronous path query. More... | |
void | Move (fixed dt) |
Do the per-turn movement and other updates. More... | |
bool | ShouldTreatTargetAsCircle (entity_pos_t range, entity_pos_t hw, entity_pos_t hh, entity_pos_t circleRadius) |
Decide whether to approximate the given range from a square target as a circle, rather than as a square. More... | |
bool | ComputeTargetPosition (CFixedVector2D &out) |
Computes the current location of our target entity (plus offset). More... | |
bool | TryGoingStraightToTargetEntity (CFixedVector2D from) |
Attempts to replace the current path with a straight line to the target entity, if it's close enough and the route is not obstructed. More... | |
bool | CheckTargetMovement (CFixedVector2D from, entity_pos_t minDelta) |
Returns whether the target entity has moved more than minDelta since our last path computations, and we're close enough to it to care. More... | |
bool | PathIsShort (const ICmpPathfinder::Path &path, CFixedVector2D from, entity_pos_t minDistance) |
Returns whether the length of the given path, plus the distance from 'from' to the first waypoints, it shorter than minDistance. More... | |
void | FaceTowardsPointFromPos (CFixedVector2D pos, entity_pos_t x, entity_pos_t z) |
Rotate to face towards the target point, given the current pos. More... | |
ControlGroupMovementObstructionFilter | GetObstructionFilter (bool forceAvoidMovingUnits=false) |
Returns an appropriate obstruction filter for use with path requests. More... | |
void | BeginPathing (CFixedVector2D from, const ICmpPathfinder::Goal &goal) |
Start moving to the given goal, from our current position 'from'. More... | |
void | RequestLongPath (CFixedVector2D from, const ICmpPathfinder::Goal &goal) |
Start an asynchronous long path query. More... | |
void | RequestShortPath (CFixedVector2D from, const ICmpPathfinder::Goal &goal, bool avoidMovingUnits) |
Start an asynchronous short path query. More... | |
bool | PickNextLongWaypoint (const CFixedVector2D &pos, bool avoidMovingUnits) |
Select a next long waypoint, given the current unit position. More... | |
void | RenderPath (const ICmpPathfinder::Path &path, std::vector< SOverlayLine > &lines, CColor color) |
Convert a path into a renderable list of lines. More... | |
void | RenderSubmit (SceneCollector &collector) |
Definition at line 103 of file CCmpUnitMotion.cpp.
Definition at line 166 of file CCmpUnitMotion.cpp.
Enumerator | |
---|---|
STATE_IDLE | |
STATE_STOPPING | |
STATE_FORMATIONMEMBER_PATH | |
STATE_INDIVIDUAL_PATH | |
STATE_MAX |
Definition at line 134 of file CCmpUnitMotion.cpp.
|
inlinestatic |
Definition at line 114 of file CCmpUnitMotion.cpp.
|
private |
Start moving to the given goal, from our current position 'from'.
Might go in a straight line immediately, or might start an asynchronous path request.
Definition at line 1161 of file CCmpUnitMotion.cpp.
|
private |
Returns whether the target entity has moved more than minDelta since our last path computations, and we're close enough to it to care.
Definition at line 1062 of file CCmpUnitMotion.cpp.
|
inlinestatic |
Definition at line 106 of file CCmpUnitMotion.cpp.
|
private |
Computes the current location of our target entity (plus offset).
Returns false if no target entity or no valid position.
Definition at line 1000 of file CCmpUnitMotion.cpp.
|
inlinestatic |
Definition at line 114 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 323 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 361 of file CCmpUnitMotion.cpp.
|
virtual |
Turn to look towards the given point.
Implements ICmpUnitMotion.
Definition at line 1123 of file CCmpUnitMotion.cpp.
|
private |
Rotate to face towards the target point, given the current pos.
Definition at line 1133 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Get the current movement speed.
Implements ICmpUnitMotion.
Definition at line 425 of file CCmpUnitMotion.cpp.
|
private |
Returns an appropriate obstruction filter for use with path requests.
Definition at line 1148 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Get the unit's passability class.
Implements ICmpUnitMotion.
Definition at line 420 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Get the default speed that this unit will have when running, in metres per second.
Implements ICmpUnitMotion.
Definition at line 415 of file CCmpUnitMotion.cpp.
|
inlinestatic |
Definition at line 242 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Get the default speed that this unit will have when walking, in metres per second.
Implements ICmpUnitMotion.
Definition at line 410 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Reimplemented from IComponent.
Definition at line 368 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 280 of file CCmpUnitMotion.cpp.
|
inlineprivate |
Definition at line 474 of file CCmpUnitMotion.cpp.
|
virtual |
Determine wether the givven point is within the given range, using the same measurement as MoveToPointRange.
Implements ICmpUnitMotion.
Definition at line 1353 of file CCmpUnitMotion.cpp.
|
virtual |
Determine whether the target is within the given range, using the same measurement as MoveToTargetRange.
Implements ICmpUnitMotion.
Definition at line 1563 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Get whether the unit is moving.
Implements ICmpUnitMotion.
Definition at line 405 of file CCmpUnitMotion.cpp.
|
private |
Do the per-turn movement and other updates.
Definition at line 765 of file CCmpUnitMotion.cpp.
|
inlineprivate |
Definition at line 492 of file CCmpUnitMotion.cpp.
|
inlineprivate |
Definition at line 510 of file CCmpUnitMotion.cpp.
|
virtual |
Join a formation, and move towards a given offset relative to the formation controller entity.
Continues following the formation until given a different command.
Implements ICmpUnitMotion.
Definition at line 1629 of file CCmpUnitMotion.cpp.
|
virtual |
Attempt to walk into range of a to a given point, or as close as possible.
If the unit is already in range, or cannot move anywhere at all, or if there is some other error, then returns false. Otherwise, returns true and sends a MotionChanged message after starting to move, and sends another MotionChanged after finishing moving. If maxRange is negative, then the maximum range is treated as infinity.
Implements ICmpUnitMotion.
Definition at line 1266 of file CCmpUnitMotion.cpp.
|
virtual |
Attempt to walk into range of a given target entity, or as close as possible.
If the unit is already in range, or cannot move anywhere at all, or if there is some other error, then returns false. Otherwise, returns true and sends a MotionChanged message after starting to move, and sends another MotionChanged after finishing moving. If maxRange is negative, then the maximum range is treated as infinity.
Implements ICmpUnitMotion.
Definition at line 1417 of file CCmpUnitMotion.cpp.
|
private |
Returns whether the length of the given path, plus the distance from 'from' to the first waypoints, it shorter than minDistance.
Definition at line 1101 of file CCmpUnitMotion.cpp.
|
private |
Handle the result of an asynchronous path query.
Definition at line 609 of file CCmpUnitMotion.cpp.
|
private |
Select a next long waypoint, given the current unit position.
Also recomputes the short path to use that waypoint. Returns false on error, or if there is no waypoint to pick.
Definition at line 1215 of file CCmpUnitMotion.cpp.
|
private |
Convert a path into a renderable list of lines.
Definition at line 1656 of file CCmpUnitMotion.cpp.
|
private |
Definition at line 1681 of file CCmpUnitMotion.cpp.
|
private |
Start an asynchronous long path query.
Definition at line 1195 of file CCmpUnitMotion.cpp.
|
private |
Start an asynchronous short path query.
Definition at line 1206 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 356 of file CCmpUnitMotion.cpp.
|
inline |
Definition at line 328 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Toggle the rendering of debug info.
Implements ICmpUnitMotion.
Definition at line 440 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Set whether the unit will turn to face the target point after finishing moving.
Implements ICmpUnitMotion.
Definition at line 435 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Set the current movement speed.
Implements ICmpUnitMotion.
Definition at line 430 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Override the default obstruction radius, used for planning paths and checking for collisions.
Bad things may happen if this entity has an active Obstruction component with a larger radius. (This is intended primarily for formation controllers.)
Implements ICmpUnitMotion.
Definition at line 463 of file CCmpUnitMotion.cpp.
|
inlineprivate |
Definition at line 469 of file CCmpUnitMotion.cpp.
|
private |
Decide whether to approximate the given range from a square target as a circle, rather than as a square.
Definition at line 1402 of file CCmpUnitMotion.cpp.
|
inlineprivate |
Definition at line 479 of file CCmpUnitMotion.cpp.
|
inlineprivate |
Definition at line 504 of file CCmpUnitMotion.cpp.
|
inlinevirtual |
Stop moving immediately.
Implements ICmpUnitMotion.
Definition at line 453 of file CCmpUnitMotion.cpp.
|
private |
Attempts to replace the current path with a straight line to the target entity, if it's close enough and the route is not obstructed.
Definition at line 1024 of file CCmpUnitMotion.cpp.
ICmpPathfinder::cost_class_t CCmpUnitMotion::m_CostClass |
Definition at line 126 of file CCmpUnitMotion.cpp.
fixed CCmpUnitMotion::m_CurSpeed |
Definition at line 233 of file CCmpUnitMotion.cpp.
bool CCmpUnitMotion::m_DebugOverlayEnabled |
Definition at line 116 of file CCmpUnitMotion.cpp.
std::vector<SOverlayLine> CCmpUnitMotion::m_DebugOverlayLongPathLines |
Definition at line 117 of file CCmpUnitMotion.cpp.
std::vector<SOverlayLine> CCmpUnitMotion::m_DebugOverlayShortPathLines |
Definition at line 118 of file CCmpUnitMotion.cpp.
u32 CCmpUnitMotion::m_ExpectedPathTicket |
Definition at line 222 of file CCmpUnitMotion.cpp.
bool CCmpUnitMotion::m_FacePointAfterMove |
Definition at line 132 of file CCmpUnitMotion.cpp.
ICmpPathfinder::Goal CCmpUnitMotion::m_FinalGoal |
Definition at line 240 of file CCmpUnitMotion.cpp.
bool CCmpUnitMotion::m_FormationController |
Definition at line 122 of file CCmpUnitMotion.cpp.
ICmpPathfinder::Path CCmpUnitMotion::m_LongPath |
Definition at line 237 of file CCmpUnitMotion.cpp.
bool CCmpUnitMotion::m_Moving |
Definition at line 131 of file CCmpUnitMotion.cpp.
ICmpPathfinder::pass_class_t CCmpUnitMotion::m_PassClass |
Definition at line 125 of file CCmpUnitMotion.cpp.
u8 CCmpUnitMotion::m_PathState |
Definition at line 220 of file CCmpUnitMotion.cpp.
entity_pos_t CCmpUnitMotion::m_Radius |
Definition at line 130 of file CCmpUnitMotion.cpp.
fixed CCmpUnitMotion::m_RunSpeed |
Definition at line 124 of file CCmpUnitMotion.cpp.
ICmpPathfinder::Path CCmpUnitMotion::m_ShortPath |
Definition at line 238 of file CCmpUnitMotion.cpp.
fixed CCmpUnitMotion::m_Speed |
Definition at line 230 of file CCmpUnitMotion.cpp.
u8 CCmpUnitMotion::m_State |
Definition at line 164 of file CCmpUnitMotion.cpp.
entity_id_t CCmpUnitMotion::m_TargetEntity |
Definition at line 224 of file CCmpUnitMotion.cpp.
entity_pos_t CCmpUnitMotion::m_TargetMaxRange |
Definition at line 228 of file CCmpUnitMotion.cpp.
entity_pos_t CCmpUnitMotion::m_TargetMinRange |
Definition at line 227 of file CCmpUnitMotion.cpp.
CFixedVector2D CCmpUnitMotion::m_TargetOffset |
Definition at line 226 of file CCmpUnitMotion.cpp.
CFixedVector2D CCmpUnitMotion::m_TargetPos |
Definition at line 225 of file CCmpUnitMotion.cpp.
fixed CCmpUnitMotion::m_WalkSpeed |
Definition at line 123 of file CCmpUnitMotion.cpp.