Pyrogenesis trunk
|
Textured line overlay, with world-space coordinates, rendered in the world onto the terrain. More...
#include <Overlay.h>
Public Types | |
enum | LineCapType { LINECAP_FLAT , LINECAP_ROUND , LINECAP_SHARP , LINECAP_SQUARE } |
Public Member Functions | |
SOverlayTexturedLine () | |
void | CreateOverlayTexture (const SOverlayDescriptor *overlayDescriptor) |
Creates the texture specified by the given overlay descriptor and assigns it to this overlay. More... | |
void | PushCoords (const float x, const float z) |
void | PushCoords (const CVector2D &v) |
void | PushCoords (const std::vector< CVector2D > &points) |
bool | IsVisibleInFrustum (const CFrustum &frustum) const |
Static Public Member Functions | |
static LineCapType | StrToLineCapType (const std::wstring &str) |
Converts a string line cap type into its corresponding LineCap enum value, and returns the resulting value. More... | |
Public Attributes | |
CTexturePtr | m_TextureBase |
CTexturePtr | m_TextureMask |
CColor | m_Color |
Color to apply to the line texture, where indicated by the mask. More... | |
std::vector< CVector2D > | m_Coords |
(x, z) vertex coordinate pairs; y is computed automatically. More... | |
float | m_Thickness |
Half-width of the line, in world-space units. More... | |
bool | m_Closed |
Should this line be treated as a closed loop? If set, any end cap settings are ignored. More... | |
bool | m_AlwaysVisible |
Should this line be rendered fully visible at all times, even under the SoD? More... | |
LineCapType | m_StartCapType |
LineCapType | m_EndCapType |
const CSimContext * | m_SimContext |
Simulation context applicable for this overlay line; used to obtain terrain information during automatic computation of Y coordinates. More... | |
std::shared_ptr< CTexturedLineRData > | m_RenderData |
Cached renderer data, because expensive to compute. More... | |
Textured line overlay, with world-space coordinates, rendered in the world onto the terrain.
Designed for relatively static textured lines, i.e. territory borders, originally.
Once submitted for rendering, instances must not be copied afterwards. The reason is that they are assigned rendering data that is unique to the submitted instance, and non-transferable to any copies that would otherwise be made. Amongst others, this restraint includes that they must not be submitted by their address inside a std::vector storing them by value.
|
inline |
void SOverlayTexturedLine::CreateOverlayTexture | ( | const SOverlayDescriptor * | overlayDescriptor | ) |
Creates the texture specified by the given overlay descriptor and assigns it to this overlay.
bool SOverlayTexturedLine::IsVisibleInFrustum | ( | const CFrustum & | frustum | ) | const |
|
inline |
|
inline |
|
inline |
|
static |
Converts a string line cap type into its corresponding LineCap enum value, and returns the resulting value.
If the input string is unrecognized, a warning is issued and a default value is returned.
bool SOverlayTexturedLine::m_AlwaysVisible |
Should this line be rendered fully visible at all times, even under the SoD?
bool SOverlayTexturedLine::m_Closed |
Should this line be treated as a closed loop? If set, any end cap settings are ignored.
CColor SOverlayTexturedLine::m_Color |
Color to apply to the line texture, where indicated by the mask.
std::vector<CVector2D> SOverlayTexturedLine::m_Coords |
(x, z) vertex coordinate pairs; y is computed automatically.
LineCapType SOverlayTexturedLine::m_EndCapType |
std::shared_ptr<CTexturedLineRData> SOverlayTexturedLine::m_RenderData |
Cached renderer data, because expensive to compute.
Allocated by the renderer when necessary for rendering purposes.
Note: the rendering data may be shared between copies of this object to prevent having to recompute it, while at the same time maintaining copyability of this object (see also docs on CTexturedLineRData).
const CSimContext* SOverlayTexturedLine::m_SimContext |
Simulation context applicable for this overlay line; used to obtain terrain information during automatic computation of Y coordinates.
LineCapType SOverlayTexturedLine::m_StartCapType |
CTexturePtr SOverlayTexturedLine::m_TextureBase |
CTexturePtr SOverlayTexturedLine::m_TextureMask |
float SOverlayTexturedLine::m_Thickness |
Half-width of the line, in world-space units.