18#ifndef INCLUDED_CCMPRALLYPOINTRENDERER
19#define INCLUDED_CCMPRALLYPOINTRENDERER
58 return !(*
this == other);
95 void Reset()
override;
102 bool IsSet()
const override;
117 std::vector<std::vector<CVector2D> >
m_Path;
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
Definition: Component.h:39
#define REGISTER_COMPONENT_TYPE(cname)
Definition: Component.h:32
int32_t player_id_t
valid player IDs are non-negative (see ICmpOwnership)
Definition: Player.h:26
Definition: CCmpRallyPointRenderer.h:68
bool m_SmoothPath
Smooth the path before rendering?
Definition: CCmpRallyPointRenderer.h:129
std::string m_LinePassabilityClass
Pathfinder passability class to use for computing the (long-range) marker line path.
Definition: CCmpRallyPointRenderer.h:158
void RecomputeRallyPointPath_wrapper(size_t index)
Recomputes the full path for m_Path[ index], and does all the necessary post-processing to make it pr...
Definition: CCmpRallyPointRenderer.cpp:370
player_id_t m_LastOwner
Last seen owner of this entity (used to keep track of ownership changes).
Definition: CCmpRallyPointRenderer.h:139
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 anoth...
Definition: CCmpRallyPointRenderer.cpp:745
std::vector< std::vector< CVector2D > > m_Path
Full path to the rally points as returned by the pathfinder, with some post-processing applied to red...
Definition: CCmpRallyPointRenderer.h:117
float m_LineThickness
Marker connector line settings (loaded from XML)
Definition: CCmpRallyPointRenderer.h:148
std::vector< std::vector< SOverlayTexturedLine > > m_TexturedOverlayLines
Textured overlay lines to be used for rendering the marker line.
Definition: CCmpRallyPointRenderer.h:167
void UpdateMarkers()
Repositions the rally point markers; moves them outside of the world (ie.
Definition: CCmpRallyPointRenderer.cpp:284
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.
Definition: CCmpRallyPointRenderer.cpp:696
void RenderSubmit(SceneCollector &collector, const CFrustum &frustum, bool culling)
Definition: CCmpRallyPointRenderer.cpp:960
std::vector< std::vector< SOverlayLine > > m_DebugNodeOverlays
Definition: CCmpRallyPointRenderer.h:173
void AddPosition_wrapper(const CFixedVector2D &pos) override
Add another position at which a marker should be displayed, connected to the previous one.
Definition: CCmpRallyPointRenderer.cpp:981
void UpdateOverlayLines()
Checks for changes to the SoD to the previously saved state, and reconstructs the visibility segments...
Definition: CCmpRallyPointRenderer.cpp:657
void Deserialize(const CParamNode ¶mNode, IDeserializer &) override
Definition: CCmpRallyPointRenderer.cpp:181
void HandleMessage(const CMessage &msg, bool) override
Definition: CCmpRallyPointRenderer.cpp:187
void ConstructAllOverlayLines()
Sets up all overlay lines for rendering according to the current full path and visibility segments.
Definition: CCmpRallyPointRenderer.cpp:504
CColor m_LineColor
Definition: CCmpRallyPointRenderer.h:149
void SetPosition(const CFixedVector2D &pos) override
Sets the position at which the rally point marker should be displayed.
Definition: CCmpRallyPointRenderer.cpp:986
void UpdateLineColor()
Helper function to set the line color to its owner's color.
Definition: CCmpRallyPointRenderer.cpp:322
bool IsSet() const override
Returns true if at least one display rally point is set; i.e., if we have a point to render our marke...
Definition: CCmpRallyPointRenderer.cpp:1073
void CreateMarkerEntity(size_t index, player_id_t ownerId)
Creates a rally point marker entity for the specified index and owner.
Definition: CCmpRallyPointRenderer.cpp:254
void Serialize(ISerializer &) override
Definition: CCmpRallyPointRenderer.cpp:176
static void ClassInit(CComponentManager &componentManager)
Definition: CCmpRallyPointRenderer.cpp:163
void Reset() override
Reset the positions of this rally point marker.
Definition: CCmpRallyPointRenderer.cpp:1036
std::vector< CFixedVector2D > m_RallyPoints
Display position of the rally points.
Definition: CCmpRallyPointRenderer.h:113
bool m_Displayed
Should we render the rally points and the path lines? (set from JS when e.g.
Definition: CCmpRallyPointRenderer.h:125
static void MergeVisibilitySegments(std::vector< SVisibilitySegment > &segments)
Helper function to GetVisibilitySegments, factored out for testing.
Definition: CCmpRallyPointRenderer.cpp:891
void UpdatePosition(std::uint32_t rallyPointId, const CFixedVector2D &pos) override
Updates the position of one given rally point marker.
Definition: CCmpRallyPointRenderer.cpp:996
bool m_EnableDebugNodeOverlay
Draw little overlay circles to indicate where the exact path points are.
Definition: CCmpRallyPointRenderer.h:172
void UpdateColor() override
Updates the line color.
Definition: CCmpRallyPointRenderer.cpp:1054
void Init(const CParamNode ¶mNode) override
Definition: CCmpRallyPointRenderer.cpp:114
void Deinit() override
Definition: CCmpRallyPointRenderer.cpp:172
std::vector< std::vector< SVisibilitySegment > > m_VisibilitySegments
Visibility segments of the rally point paths; splits the path into SoD/non-SoD segments.
Definition: CCmpRallyPointRenderer.h:121
void SetDisplayed(bool displayed) override
Sets whether the rally point marker and line should be displayed.
Definition: CCmpRallyPointRenderer.cpp:1011
std::vector< entity_id_t > m_MarkerEntityIds
Entity IDs of the rally point markers.
Definition: CCmpRallyPointRenderer.h:133
std::wstring m_LineTextureMaskPath
Definition: CCmpRallyPointRenderer.h:154
void UpdateMessageSubscriptions()
Definition: CCmpRallyPointRenderer.cpp:249
CTexturePtr m_TextureMask
Definition: CCmpRallyPointRenderer.h:161
SOverlayTexturedLine::LineCapType m_LineStartCapType
Definition: CCmpRallyPointRenderer.h:151
void RecomputeAllRallyPointPaths()
Recomputes all the full paths from this entity to the rally point and from the rally point to the nex...
Definition: CCmpRallyPointRenderer.cpp:343
std::wstring m_MarkerTemplate
Template name of the rally point markers.
Definition: CCmpRallyPointRenderer.h:143
void ConstructOverlayLines(size_t index)
Sets up the overlay lines for rendering according to the full path and visibility segments at index.
Definition: CCmpRallyPointRenderer.cpp:512
size_t m_LastMarkerCount
Definition: CCmpRallyPointRenderer.h:135
std::wstring m_LineTexturePath
Definition: CCmpRallyPointRenderer.h:153
CColor m_LineDashColor
Definition: CCmpRallyPointRenderer.h:150
CTexturePtr m_Texture
Definition: CCmpRallyPointRenderer.h:160
void GetVisibilitySegments(std::vector< SVisibilitySegment > &out, size_t index) const
Returns a list of indices of waypoints in the current path (m_Path[index]) where the LOS visibility c...
Definition: CCmpRallyPointRenderer.cpp:844
static std::string GetSchema()
Definition: CCmpRallyPointRenderer.cpp:58
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,...
Definition: CCmpRallyPointRenderer.cpp:387
void AddPosition(CFixedVector2D pos, bool recompute)
Helper function for AddPosition_wrapper and SetPosition.
Definition: CCmpRallyPointRenderer.cpp:1060
SOverlayTexturedLine::LineCapType m_LineEndCapType
Definition: CCmpRallyPointRenderer.h:152
Definition: ComponentManager.h:46
Definition: FixedVector2D.h:25
An entity initialisation parameter node.
Definition: ParamNode.h:153
A simplified syntax for accessing entity components.
Definition: CmpPtr.h:58
Pathfinder algorithms.
Definition: ICmpPathfinder.h:63
Represents an entity's position in the world (plus its orientation).
Definition: ICmpPosition.h:65
Rally Point.
Definition: ICmpRallyPointRenderer.h:32
Deserialization interface; see serialization overview.
Definition: IDeserializer.h:40
Serialization interface; see serialization overview.
Definition: ISerializer.h:126
This interface accepts renderable objects.
Definition: Scene.h:90
std::shared_ptr< CTexture > CTexturePtr
Definition: Texture.h:25
LineCapType
Definition: Overlay.h:71
Definition: CCmpRallyPointRenderer.h:42
SVisibilitySegment(bool visible, size_t startIndex, size_t endIndex)
Definition: CCmpRallyPointRenderer.h:47
size_t m_StartIndex
Definition: CCmpRallyPointRenderer.h:44
bool m_Visible
Definition: CCmpRallyPointRenderer.h:43
bool operator!=(const SVisibilitySegment &other) const
Definition: CCmpRallyPointRenderer.h:56
bool operator==(const SVisibilitySegment &other) const
Definition: CCmpRallyPointRenderer.h:51
size_t m_EndIndex
Definition: CCmpRallyPointRenderer.h:45
bool IsSinglePoint() const
Definition: CCmpRallyPointRenderer.h:61
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:407