18#ifndef INCLUDED_CCMPRALLYPOINTRENDERER
19#define INCLUDED_CCMPRALLYPOINTRENDERER
60 return !(*
this == other);
97 void Reset()
override;
104 bool IsSet()
const override;
119 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
Helper functions related to geometry algorithms.
int32_t player_id_t
valid player IDs are non-negative (see ICmpOwnership)
Definition: Player.h:24
Definition: CCmpRallyPointRenderer.h:70
void Serialize(ISerializer &serialize) override
Definition: CCmpRallyPointRenderer.cpp:143
bool m_SmoothPath
Smooth the path before rendering?
Definition: CCmpRallyPointRenderer.h:131
std::string m_LinePassabilityClass
Pathfinder passability class to use for computing the (long-range) marker line path.
Definition: CCmpRallyPointRenderer.h:160
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:335
player_id_t m_LastOwner
Last seen owner of this entity (used to keep track of ownership changes).
Definition: CCmpRallyPointRenderer.h:141
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:710
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:119
float m_LineThickness
Marker connector line settings (loaded from XML)
Definition: CCmpRallyPointRenderer.h:150
std::vector< std::vector< SOverlayTexturedLine > > m_TexturedOverlayLines
Textured overlay lines to be used for rendering the marker line.
Definition: CCmpRallyPointRenderer.h:169
void UpdateMarkers()
Repositions the rally point markers; moves them outside of the world (ie.
Definition: CCmpRallyPointRenderer.cpp:221
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:661
void RenderSubmit(SceneCollector &collector, const CFrustum &frustum, bool culling)
Definition: CCmpRallyPointRenderer.cpp:925
std::vector< std::vector< SOverlayLine > > m_DebugNodeOverlays
Definition: CCmpRallyPointRenderer.h:175
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:946
void HandleMessage(const CMessage &msg, bool global) override
Definition: CCmpRallyPointRenderer.cpp:154
void UpdateOverlayLines()
Checks for changes to the SoD to the previously saved state, and reconstructs the visibility segments...
Definition: CCmpRallyPointRenderer.cpp:622
void ConstructAllOverlayLines()
Sets up all overlay lines for rendering according to the current full path and visibility segments.
Definition: CCmpRallyPointRenderer.cpp:469
CColor m_LineColor
Definition: CCmpRallyPointRenderer.h:151
void SetPosition(const CFixedVector2D &pos) override
Sets the position at which the rally point marker should be displayed.
Definition: CCmpRallyPointRenderer.cpp:951
void UpdateLineColor()
Helper function to set the line color to its owner's color.
Definition: CCmpRallyPointRenderer.cpp:287
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:1038
static void ClassInit(CComponentManager &componentManager)
Definition: CCmpRallyPointRenderer.cpp:130
void Reset() override
Reset the positions of this rally point marker.
Definition: CCmpRallyPointRenderer.cpp:1001
std::vector< CFixedVector2D > m_RallyPoints
Display position of the rally points.
Definition: CCmpRallyPointRenderer.h:115
bool m_Displayed
Should we render the rally points and the path lines? (set from JS when e.g.
Definition: CCmpRallyPointRenderer.h:127
static void MergeVisibilitySegments(std::vector< SVisibilitySegment > &segments)
Helper function to GetVisibilitySegments, factored out for testing.
Definition: CCmpRallyPointRenderer.cpp:856
void Deserialize(const CParamNode ¶mNode, IDeserializer &deserialize) override
Definition: CCmpRallyPointRenderer.cpp:148
bool m_EnableDebugNodeOverlay
Draw little overlay circles to indicate where the exact path points are.
Definition: CCmpRallyPointRenderer.h:174
void UpdateColor() override
Updates the line color.
Definition: CCmpRallyPointRenderer.cpp:1019
void Init(const CParamNode ¶mNode) override
Definition: CCmpRallyPointRenderer.cpp:81
void Deinit() override
Definition: CCmpRallyPointRenderer.cpp:139
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:123
void UpdatePosition(u32 rallyPointId, const CFixedVector2D &pos) override
Updates the position of one given rally point marker.
Definition: CCmpRallyPointRenderer.cpp:961
void SetDisplayed(bool displayed) override
Sets whether the rally point marker and line should be displayed.
Definition: CCmpRallyPointRenderer.cpp:976
std::vector< entity_id_t > m_MarkerEntityIds
Entity IDs of the rally point markers.
Definition: CCmpRallyPointRenderer.h:135
std::wstring m_LineTextureMaskPath
Definition: CCmpRallyPointRenderer.h:156
virtual void UpdateMessageSubscriptions()
Definition: CCmpRallyPointRenderer.cpp:216
CTexturePtr m_TextureMask
Definition: CCmpRallyPointRenderer.h:163
SOverlayTexturedLine::LineCapType m_LineStartCapType
Definition: CCmpRallyPointRenderer.h:153
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:308
std::wstring m_MarkerTemplate
Template name of the rally point markers.
Definition: CCmpRallyPointRenderer.h:145
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:477
size_t m_LastMarkerCount
Definition: CCmpRallyPointRenderer.h:137
std::wstring m_LineTexturePath
Definition: CCmpRallyPointRenderer.h:155
CColor m_LineDashColor
Definition: CCmpRallyPointRenderer.h:152
CTexturePtr m_Texture
Definition: CCmpRallyPointRenderer.h:162
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:809
static std::string GetSchema()
Definition: CCmpRallyPointRenderer.cpp:25
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:352
void AddPosition(CFixedVector2D pos, bool recompute)
Helper function for AddPosition_wrapper and SetPosition.
Definition: CCmpRallyPointRenderer.cpp:1025
SOverlayTexturedLine::LineCapType m_LineEndCapType
Definition: CCmpRallyPointRenderer.h:154
Definition: ComponentManager.h:40
Definition: FixedVector2D.h:25
An entity initialisation parameter node.
Definition: ParamNode.h:151
A simplified syntax for accessing entity components.
Definition: CmpPtr.h:56
Rally Point.
Definition: ICmpRallyPointRenderer.h:30
Deserialization interface; see serialization overview.
Definition: IDeserializer.h:35
Serialization interface; see serialization overview.
Definition: ISerializer.h:121
This interface accepts renderable objects.
Definition: Scene.h:90
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning.
Definition: code_annotation.h:40
std::shared_ptr< CTexture > CTexturePtr
Definition: Texture.h:23
LineCapType
Definition: Overlay.h:68
Definition: CCmpRallyPointRenderer.h:44
SVisibilitySegment(bool visible, size_t startIndex, size_t endIndex)
Definition: CCmpRallyPointRenderer.h:49
size_t m_StartIndex
Definition: CCmpRallyPointRenderer.h:46
bool m_Visible
Definition: CCmpRallyPointRenderer.h:45
bool operator!=(const SVisibilitySegment &other) const
Definition: CCmpRallyPointRenderer.h:58
bool operator==(const SVisibilitySegment &other) const
Definition: CCmpRallyPointRenderer.h:53
size_t m_EndIndex
Definition: CCmpRallyPointRenderer.h:47
bool IsSinglePoint() const
Definition: CCmpRallyPointRenderer.h:63
uint32_t u32
Definition: types.h:39
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:407