6 #include "LabelViewTypes.h"
7 #include "IAnchoredLabel.h"
8 #include "LabelStyle.h"
10 #include "AxisAlignedBox2.h"
11 #include "ShapedGlyph.h"
22 typedef IAnchoredLabel::IdType IdType;
23 const static int LOD_ARRAY_SIZE = 2;
27 bool hasTextComponent,
28 bool hasIconComponent,
30 const v2& textAlignmentOffset,
32 const v2& iconAlignmentOffset,
34 bool horizonCullAlwaysRequired,
38 u32 componentMaskPerLod[LOD_ARRAY_SIZE]);
42 void NotifyAnchorChanged();
44 bool HasCachedAnchorBasisEcef()
const {
return m_hasCachedAnchorBasisEcef; }
48 static void UpdateTransformsPrefetch(
const LabelView* pLabelView);
53 static void UpdateFadeStatePrefetch(
const LabelView* pLabelView);
54 void UpdateFadeState(
float dt);
56 const std::vector<Text::ShapedGlyph>& GetShapedGlyphs()
const {
return m_shapedGlyphs; }
59 const LabelStyle& GetStyle()
const {
return *m_pLabelStyle; }
60 int GetStyleIndex()
const {
return m_styleIndex; }
62 v2 GetTextTranslate()
const {
return m_textTranslate; }
63 v2 GetIconTranslate()
const {
return m_iconTranslate; }
64 v2 GetRotate()
const {
return m_rotateCosSin; }
65 v2 GetTextScale()
const {
return m_textScale; }
66 const v2& GetIconScale()
const {
return m_iconScale; }
67 float GetGlyphSizeScale()
const {
return m_glyphSizeScale; }
68 LabelDisplay::Type GetDisplayType()
const {
return m_displayType; }
69 bool WillIgnoreOcclusion()
const {
return m_willIgnoreOcclusion; }
75 m44 GetCameraRelativeWorldTransform()
const;
77 int GetPriority()
const {
return m_priority; }
78 int GetSubPriority()
const {
return m_subPriority; }
79 float GetFadeParam()
const {
return m_fadeParam; }
80 float GetTextFadeParam()
const {
return m_textFadeParam; }
81 bool ShouldDisplayComponent(
const LabelComponent::Type labelComponent)
const;
83 bool IsAxisAligned()
const {
return m_orientationType == LabelOrientation::Screen; }
84 int GetTiebreakPriority()
const {
return m_tieBreakPriority; }
86 bool HasComponent(
const LabelComponent::Type labelComponent)
const {
return ((m_componentMask & (1 << labelComponent)) > 0) ?
true :
false; }
87 u32 GetComponentMask()
const {
return m_componentMask; }
89 int GetOccludableComponentCount()
const {
return m_occludableComponentCount; }
92 LabelFadeState::Type GetFadeState()
const {
return m_fadeState; }
100 bool ShouldDisplayForLevel(
int zLevel)
const;
102 bool IsHidden()
const {
return m_isHidden; }
103 void SetHidden(
bool hidden) { m_isHidden = hidden; }
104 const IAnchoredLabel& GetAnchoredLabel()
const {
return *m_pAnchoredLabel; }
106 int GetPickingGroup()
const {
return m_pickingGroup; }
108 int GetLod()
const {
return m_lod; }
109 void SetLod(
int lod) { Eegeo_ASSERT_SLOW(lod < m_lodCount); m_lod = lod; }
110 bool IsInvisibleLod()
const {
return m_lod < 0; }
111 int GetLodCount()
const {
return m_lodCount; }
112 u32 GetComponentMaskForLod(
int lod)
const { Eegeo_ASSERT_SLOW(lod >= 0 && lod < m_lodCount);
return m_componentMaskPerLod[lod]; }
115 float GetViewDepth()
const {
return m_viewDepth; }
117 void UpdateAnchorBasisEcef(
const m44& inverseViewMatrix,
float environmentFlatteningScale);
119 v2 CalcTranslate(
const v2& anchorScreenPos,
const v2& rotateCosSin,
const v2& alignmentOffset,
const v2& layoutScale)
const;
121 m44 CalcAnchorBasisEcef(
const m44& inverseViewMatrix,
float environmentFlatteningScale)
const;
122 void CacheValueFromAnchoredLabel();
129 dv3 m_anchorUnflattenedEcef;
131 v3 m_anchorBasisEcefRight;
133 v2 m_textAlignmentOffset;
135 v2 m_iconAlignmentOffset;
136 float m_anchorConstraintRadiusEcef;
137 float m_precalcConstraintRadiusSq;
138 const int m_occludableComponentCount;
140 const float m_screenMargin;
141 const ScreenMarginHiding::Type m_screenMarginHiding;
142 LabelPlacement::Type m_anchorLabelPlacementType;
143 LabelOrientation::Type m_orientationType;
144 LabelFadeState::Type m_fadeState;
145 LabelDisplay::Type m_displayType;
146 bool m_hasCachedAnchorBasisEcef;
147 bool m_canCacheAnchorOffset;
148 bool m_anchorChanged;
149 bool m_horizonCullAlwaysRequired;
151 inline static int HotWriteFieldsOffset() {
return offsetof(
LabelView, m_textOrientedBounds); }
159 v3 m_anchorBasisEcefTranslate;
160 v3 m_anchorBasisEcefUp;
161 v3 m_anchorBasisEcefForward;
166 bool m_exceedsConstraintRadius;
169 bool m_isEcefBackFacing;
171 bool m_isOutsideScreenMargin;
172 const bool m_willIgnoreOcclusion;
175 float m_anchorAltitude;
176 float m_anchorAltitudeOffset;
178 float m_textFadeParam;
179 float m_glyphSizeScale;
182 int m_tieBreakPriority;
185 u32 m_componentMaskPerLod[LOD_ARRAY_SIZE];
188 const int m_styleIndex;
189 std::vector<Text::ShapedGlyph> m_shapedGlyphs;