OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 gvr::Vec3f GetNormal() const; | 56 gvr::Vec3f GetNormal() const; |
57 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const; | 57 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const; |
58 }; | 58 }; |
59 | 59 |
60 struct ContentRectangle : public WorldRectangle { | 60 struct ContentRectangle : public WorldRectangle { |
61 ContentRectangle(); | 61 ContentRectangle(); |
62 ~ContentRectangle(); | 62 ~ContentRectangle(); |
63 | 63 |
64 void Animate(int64_t time); | 64 void Animate(int64_t time); |
65 | 65 |
| 66 // Indicates whether the element should be visually rendered. |
| 67 bool IsVisible() const; |
| 68 |
| 69 // Indicates whether the element should be tested for cursor input. |
| 70 bool IsHitTestable() const; |
| 71 |
66 // Valid IDs are non-negative. | 72 // Valid IDs are non-negative. |
67 int id = -1; | 73 int id = -1; |
68 | 74 |
69 // If a non-negative parent ID is specified, applicable tranformations | 75 // If a non-negative parent ID is specified, applicable tranformations |
70 // are applied relative to the parent, rather than absolutely. | 76 // are applied relative to the parent, rather than absolutely. |
71 int parent_id = -1; | 77 int parent_id = -1; |
72 | 78 |
73 // If true, this object will be visible. | 79 // If true, this object will be visible. |
74 bool visible = true; | 80 bool visible = true; |
75 | 81 |
(...skipping 17 matching lines...) Expand all Loading... |
93 // The scale of the object, and its children. | 99 // The scale of the object, and its children. |
94 gvr::Vec3f scale = {1.0f, 1.0f, 1.0f}; | 100 gvr::Vec3f scale = {1.0f, 1.0f, 1.0f}; |
95 | 101 |
96 // The rotation of the object, and its children. | 102 // The rotation of the object, and its children. |
97 RotationAxisAngle rotation = {1.0f, 0.0f, 0.0f, 0.0f}; | 103 RotationAxisAngle rotation = {1.0f, 0.0f, 0.0f, 0.0f}; |
98 | 104 |
99 // The translation of the object, and its children. Translation is applied | 105 // The translation of the object, and its children. Translation is applied |
100 // after rotation and scaling. | 106 // after rotation and scaling. |
101 gvr::Vec3f translation = {0.0f, 0.0f, 0.0f}; | 107 gvr::Vec3f translation = {0.0f, 0.0f, 0.0f}; |
102 | 108 |
| 109 // The opacity of the object (between 0.0 and 1.0). |
| 110 float opacity = 1.0f; |
| 111 |
| 112 // The computed opacity, incorporating opacity of parent objects. |
| 113 float computed_opacity; |
| 114 |
103 // If anchoring is specified, the translation will be relative to the | 115 // If anchoring is specified, the translation will be relative to the |
104 // specified edge(s) of the parent, rather than the center. A parent object | 116 // specified edge(s) of the parent, rather than the center. A parent object |
105 // must be specified when using anchoring. | 117 // must be specified when using anchoring. |
106 XAnchoring x_anchoring = XAnchoring::XNONE; | 118 XAnchoring x_anchoring = XAnchoring::XNONE; |
107 YAnchoring y_anchoring = YAnchoring::YNONE; | 119 YAnchoring y_anchoring = YAnchoring::YNONE; |
108 | 120 |
109 // Animations that affect the properties of the object over time. | 121 // Animations that affect the properties of the object over time. |
110 std::vector<std::unique_ptr<Animation>> animations; | 122 std::vector<std::unique_ptr<Animation>> animations; |
111 | 123 |
112 private: | 124 private: |
113 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); | 125 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); |
114 }; | 126 }; |
115 | 127 |
116 } // namespace vr_shell | 128 } // namespace vr_shell |
117 | 129 |
118 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 130 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
OLD | NEW |