Pyrogenesis
trunk
|
Public Member Functions | |
virtual int | GetComponentTypeId () const |
virtual void | Init (const CParamNode ¶mNode) |
virtual void | Deinit () |
virtual void | Serialize (ISerializer &serialize) |
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) |
virtual void | HandleMessage (const CMessage &msg, bool global) |
void | UpdateMessageSubscriptions () |
virtual void | AddPosition_wrapper (const CFixedVector2D &pos) |
Add another position at which a marker should be displayed, connected to the previous one. More... | |
virtual void | SetPosition (const CFixedVector2D &pos) |
Sets the position at which the rally point marker should be displayed. More... | |
virtual void | UpdatePosition (u32 rallyPointId, const CFixedVector2D &pos) |
Updates the position of one given rally point marker. More... | |
virtual void | SetDisplayed (bool displayed) |
Sets whether the rally point marker and line should be displayed. More... | |
virtual void | Reset () |
Reset the positions of this rally point marker. More... | |
bool | IsSet () const |
Returns true if at least one display rally point is set; i.e., if we have a point to render our marker/line at. More... | |
Public Member Functions inherited from IComponent | |
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 bool | NewJSObject (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 |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (ScriptInterface &, JS::HandleValue) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
Static Public Member Functions inherited from IComponent | |
static std::string | GetSchema () |
static u8 | GetSerializationVersion () |
Protected Attributes | |
std::vector< CFixedVector2D > | m_RallyPoints |
Display position of the rally points. More... | |
std::vector< std::vector< CVector2D > > | m_Path |
Full path to the rally points as returned by the pathfinder, with some post-processing applied to reduce zig/zagging. More... | |
std::deque< std::deque< SVisibilitySegment > > | m_VisibilitySegments |
Visibility segments of the rally point paths; splits the path into SoD/non-SoD segments. More... | |
bool | m_Displayed |
Should we render the rally points and the path lines? (set from JS when e.g. the unit is selected/deselected) More... | |
bool | m_SmoothPath |
Smooth the path before rendering? More... | |
std::vector< entity_id_t > | m_MarkerEntityIds |
Entity IDs of the rally point markers. More... | |
size_t | m_LastMarkerCount |
player_id_t | m_LastOwner |
Last seen owner of this entity (used to keep track of ownership changes). More... | |
std::wstring | m_MarkerTemplate |
Template name of the rally point markers. More... | |
float | m_LineThickness |
Marker connector line settings (loaded from XML) More... | |
CColor | m_LineColor |
CColor | m_LineDashColor |
LineCapType | m_LineStartCapType |
LineCapType | m_LineEndCapType |
std::wstring | m_LineTexturePath |
std::wstring | m_LineTextureMaskPath |
std::string | m_LinePassabilityClass |
Pathfinder passability class to use for computing the (long-range) marker line path. More... | |
CTexturePtr | m_Texture |
CTexturePtr | m_TextureMask |
std::vector< std::vector< SOverlayTexturedLine > > | m_TexturedOverlayLines |
Textured overlay lines to be used for rendering the marker line. More... | |
bool | m_EnableDebugNodeOverlay |
Draw little overlay circles to indicate where the exact path points are? More... | |
std::vector< std::vector< SOverlayLine > > | m_DebugNodeOverlays |
Private Types | |
typedef WaypointPath | Path |
typedef PathGoal | Goal |
typedef ICmpRangeManager::CLosQuerier | CLosQuerier |
typedef SOverlayTexturedLine::LineCapType | LineCapType |
Private Member Functions | |
void | AddPosition (CFixedVector2D pos, bool recompute) |
Helper function for AddPosition_wrapper and SetPosition. More... | |
void | UpdateMarkers () |
Repositions the rally point markers; moves them outside of the world (ie. More... | |
void | RecomputeAllRallyPointPaths () |
Recomputes all the full paths from this entity to the rally point and from the rally point to the next, and does all the necessary post-processing to make them prettier. More... | |
void | RecomputeRallyPointPath_wrapper (size_t index) |
Recomputes the full path for m_Path[ index ], and does all the necessary post-processing to make it prettier. More... | |
void | RecomputeRallyPointPath (size_t index, CmpPtr< ICmpPosition > &cmpPosition, CmpPtr< ICmpFootprint > &cmpFootprint, CmpPtr< ICmpPathfinder > cmpPathfinder) |
Recomputes the full path from this entity/the previous rally point to the next rally point, and does all the necessary post-processing to make it prettier. More... | |
void | UpdateOverlayLines () |
Checks for changes to the SoD to the previously saved state, and reconstructs the visibility segments and overlay lines to match if necessary. More... | |
void | ConstructAllOverlayLines () |
Sets up all overlay lines for rendering according to the current full path and visibility segments. More... | |
void | ConstructOverlayLines (size_t index) |
Sets up the overlay lines for rendering according to the full path and visibility segments at index . More... | |
void | FixFootprintWaypoints (std::vector< CVector2D > &coords, CmpPtr< ICmpPosition > cmpPosition, CmpPtr< ICmpFootprint > cmpFootprint) const |
Removes points from coords that are obstructed by the originating building's footprint, and links up the last point nicely to the edge of the building's footprint. More... | |
void | GetClosestsEdgePointFrom (CFixedVector2D &result, CFixedVector2D &start, CmpPtr< ICmpPosition > cmpPosition, CmpPtr< ICmpFootprint > cmpFootprint) const |
Get the point on the footprint edge that's as close from "start" as possible. More... | |
void | GetVisibilitySegments (std::deque< SVisibilitySegment > &out, size_t index) const |
Returns a list of indices of waypoints in the current path (m_Path[index]) where the LOS visibility changes, ordered from building/previous rally point to rally point. More... | |
void | ReduceSegmentsByVisibility (std::vector< CVector2D > &coords, unsigned maxSegmentLinks=0, bool floating=true) const |
Simplifies the path by removing waypoints that lie between two points that are visible from one another. More... | |
void | RenderSubmit (SceneCollector &collector) |
Static Private Member Functions | |
static void | MergeVisibilitySegments (std::deque< SVisibilitySegment > &segments) |
Helper function to GetVisibilitySegments, factored out for testing. More... | |
|
private |
|
private |
|
private |
|
private |
|
inlineprivate |
Helper function for AddPosition_wrapper and SetPosition.
|
inlinevirtual |
Add another position at which a marker should be displayed, connected to the previous one.
Implements ICmpRallyPointRenderer.
|
inlinestatic |
|
inlinestatic |
|
private |
Sets up all overlay lines for rendering according to the current full path and visibility segments.
Splits the line into solid and dashed pieces (for the SoD). Should be called whenever the SoD has changed. If no full path is currently set, this method does nothing.
|
private |
Sets up the overlay lines for rendering according to the full path and visibility segments at index
.
Splits the line into solid and dashed pieces (for the SoD). Should be called whenever the SoD of the path at index
has changed.
|
inlinestatic |
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Implements IComponent.
|
private |
Removes points from coords
that are obstructed by the originating building's footprint, and links up the last point nicely to the edge of the building's footprint.
Only needed if the pathfinder can possibly return obstructed tile waypoints, i.e. when pathfinding is started from an obstructed tile.
|
private |
Get the point on the footprint edge that's as close from "start" as possible.
|
inlinevirtual |
Implements IComponent.
|
inlinestatic |
|
private |
Returns a list of indices of waypoints in the current path (m_Path[index]) where the LOS visibility changes, ordered from building/previous rally point to rally point.
Used to construct the overlay line segments and track changes to the SoD.
|
inlinevirtual |
Reimplemented from IComponent.
|
virtual |
Implements IComponent.
|
inlinevirtual |
Returns true if at least one display rally point is set; i.e., if we have a point to render our marker/line at.
Implements ICmpRallyPointRenderer.
|
staticprivate |
Helper function to GetVisibilitySegments, factored out for testing.
Merges single-point segments with its neighbouring segments. You should not have to call this method directly.
|
private |
Recomputes all the full paths from this entity to the rally point and from the rally point to the next, and does all the necessary post-processing to make them prettier.
Should be called whenever all rally points' position changes.
|
private |
Recomputes the full path from this entity/the previous rally point to the next rally point, and does all the necessary post-processing to make it prettier.
This doesn't check if we have a valid position or if a rally point is set.
You shouldn't need to call this method directly.
|
private |
Recomputes the full path for m_Path[ index
], and does all the necessary post-processing to make it prettier.
Should be called whenever either the starting position or the rally point's position changes.
|
private |
Simplifies the path by removing waypoints that lie between two points that are visible from one another.
This is primarily intended to reduce some unnecessary curviness of the path; the pathfinder returns a mathematically (near-)optimal path, which will happily curve and bend to reduce costs. Visually, it doesn't make sense for a rally point path to curve and bend when it could just as well have gone in a straight line; that's why we have this, to make it look more natural.
coords
array of path coordinates to simplify maxSegmentLinks
if non-zero, indicates the maximum amount of consecutive node-to-node links that can be joined into a single link. If this value is set to e.g. 1, then no reductions will be performed. A value of 3 means that at most 3 consecutive node links will be joined into a single link. floating
whether to consider nodes who are under the water level as floating on top of the water
|
private |
|
inlinevirtual |
Reset the positions of this rally point marker.
Implements ICmpRallyPointRenderer.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Sets whether the rally point marker and line should be displayed.
Implements ICmpRallyPointRenderer.
|
inlinevirtual |
Sets the position at which the rally point marker should be displayed.
Discards all previous positions
Implements ICmpRallyPointRenderer.
|
private |
Repositions the rally point markers; moves them outside of the world (ie.
hides them), or positions them at the currently set rally points. Also updates the actor's variation according to the entity's current owning player's civilization.
Should be called whenever either the position of a rally point changes (including whether it is set or not), or the display flag changes, or the ownership of the entity changes.
|
inline |
|
private |
Checks for changes to the SoD to the previously saved state, and reconstructs the visibility segments and overlay lines to match if necessary.
Does nothing if the rally point lines are not currently set to be displayed, or if no rally point is set.
|
inlinevirtual |
Updates the position of one given rally point marker.
Implements ICmpRallyPointRenderer.
|
protected |
|
protected |
Should we render the rally points and the path lines? (set from JS when e.g. the unit is selected/deselected)
|
protected |
Draw little overlay circles to indicate where the exact path points are?
|
protected |
|
protected |
Last seen owner of this entity (used to keep track of ownership changes).
|
protected |
|
protected |
|
protected |
|
protected |
Pathfinder passability class to use for computing the (long-range) marker line path.
|
protected |
|
protected |
|
protected |
|
protected |
Marker connector line settings (loaded from XML)
|
protected |
Entity IDs of the rally point markers.
|
protected |
Template name of the rally point markers.
|
protected |
Full path to the rally points as returned by the pathfinder, with some post-processing applied to reduce zig/zagging.
|
protected |
Display position of the rally points.
Note that this are merely the display positions; they not necessarily the same as the actual positions used in the simulation at any given time. In particular, we need this separate copy to support instantaneously rendering the rally point markers/lines when the user sets one in-game (instead of waiting until the network-synchronization code sets it on the RallyPoint component, which might take up to half a second).
|
protected |
Smooth the path before rendering?
|
protected |
|
protected |
Textured overlay lines to be used for rendering the marker line.
There can be multiple because we may need to render dashes for segments that are inside the SoD.
|
protected |
|
protected |
Visibility segments of the rally point paths; splits the path into SoD/non-SoD segments.