All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LabelViewTypes.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Labels.h"
7 #include "OrientedBox2.h"
8 #include "AxisAlignedBox2.h"
9 #include "Bounds.h"
10 
11 #include <vector>
12 #include <utility>
13 
14 namespace Eegeo
15 {
16  namespace Labels
17  {
18  namespace LabelViewVisibility
19  {
20  enum Type
21  {
22  CulledExceededConstraintRadius,
23  CulledGuardBand,
24  CulledBehindCamera,
25  CulledBehindGlobeHorizon,
26  CulledViewportAABB,
27  PotentiallyVisible
28  };
29  }
30 
31  namespace LabelFadeState
32  {
33  enum Type
34  {
35  NotDetermined,
36  Off,
37  FadingOut,
38  FadingIn,
39  On
40 
41  };
42  }
43 
44  namespace LabelComponent
45  {
46  enum Type
47  {
48  Text,
49  Icon,
50  _Count
51  };
52  }
53 
54  inline u32 LabelComponentToFlags(const LabelComponent::Type labelComponent)
55  {
56  return 1 << labelComponent;
57  }
58 
60  {
61  m44 InverseViewMatrix;
62  bool EnvironmentFlatteningChanged;
63  float EnvironmentFlatteningScale;
64  v3 ViewProjectionColumnX;
65  v3 ViewProjectionColumnY;
66  v3 ViewProjectionColumnZ;
67  dv3 CameraOrigin;
68  v3 CameraEcefUp;
69  float CameraAltitude;
70  bool PerformHorizonCullOfLabels;
71  v2 ViewportOrigin;
72  v2 ViewportDimensions;
73  Geometry::AxisAlignedBox2 ViewportBounds;
74  float GuardBand;
75  float AnchorConstraintRadiusScaleSquared;
76  float AnchorConstraintHysteresisSquared;
77  float FadeDelta;
78  int ZLevel;
79  };
80 
81 
83  {
84  Geometry::AxisAlignedBox2 LabelAxisAlignedBounds;
85  Geometry::OrientedBox2 TextOrientedBounds;
86  Geometry::AxisAlignedBox2 TextAxisAlignedBounds;
87  Geometry::OrientedBox2 IconOrientedBounds;
88  Geometry::AxisAlignedBox2 IconAxisAlignedBounds;
89  v3 AnchorBasisEcefTranslate;
90  v2 RotateCosSin;
91  v2 TextTranslate;
92  v2 IconTranslate;
93  float ViewDepth;
94  bool ExceedsConstraintRadius;
95  bool EcefBackFacing;
96  bool IsOutsideScreenMargin;
97  };
98 
99  struct MvpMatrix
100  {
101  float row0x;
102  float row0y;
103  float row0w;
104  float row3x;
105  float row3y;
106  float row3w;
107 
108  inline float DetX() const
109  {
110  return row0x*row3w - row3x*row0w;
111  }
112 
113  inline float DetY() const
114  {
115  return row3y*row0w - row0y*row3w;
116  }
117  };
118 
119  }
120 }