Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 XLEFT, | 21 XLEFT, |
| 22 XRIGHT | 22 XRIGHT |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 enum YAnchoring { | 25 enum YAnchoring { |
| 26 YNONE = 0, | 26 YNONE = 0, |
| 27 YTOP, | 27 YTOP, |
| 28 YBOTTOM | 28 YBOTTOM |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 enum Fill { | |
| 32 NONE = 0, | |
| 33 SPRITE = 1, | |
| 34 OPAQUE_GRADIENT = 2, | |
| 35 GRID_GRADIENT = 3, | |
| 36 // The element is the content quad. Only one content quad may be added to the | |
|
cjgrant
2017/02/02 14:48:25
If commenting the type, please comment the others
tiborg1
2017/02/02 16:52:27
Good point. Done.
| |
| 37 // scene. | |
| 38 CONTENT = 4 | |
| 39 }; | |
| 40 | |
| 31 struct ReversibleTransform { | 41 struct ReversibleTransform { |
| 32 ReversibleTransform(); | 42 ReversibleTransform(); |
| 33 | 43 |
| 34 void MakeIdentity(); | 44 void MakeIdentity(); |
| 35 void Rotate(gvr::Quatf quat); | 45 void Rotate(gvr::Quatf quat); |
| 36 void Rotate(float ax, float ay, float az, float rad); | 46 void Rotate(float ax, float ay, float az, float rad); |
| 37 void Translate(float tx, float ty, float tz); | 47 void Translate(float tx, float ty, float tz); |
| 38 void Scale(float sx, float sy, float sz); | 48 void Scale(float sx, float sy, float sz); |
| 39 | 49 |
| 40 gvr::Mat4f to_world; | 50 gvr::Mat4f to_world; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 65 | 75 |
| 66 // Indicates whether the element should be visually rendered. | 76 // Indicates whether the element should be visually rendered. |
| 67 bool IsVisible() const; | 77 bool IsVisible() const; |
| 68 | 78 |
| 69 // Indicates whether the element should be tested for cursor input. | 79 // Indicates whether the element should be tested for cursor input. |
| 70 bool IsHitTestable() const; | 80 bool IsHitTestable() const; |
| 71 | 81 |
| 72 // Valid IDs are non-negative. | 82 // Valid IDs are non-negative. |
| 73 int id = -1; | 83 int id = -1; |
| 74 | 84 |
| 75 // If a non-negative parent ID is specified, applicable tranformations | 85 // If a non-negative parent ID is specified, applicable transformations |
| 76 // are applied relative to the parent, rather than absolutely. | 86 // are applied relative to the parent, rather than absolutely. |
| 77 int parent_id = -1; | 87 int parent_id = -1; |
| 78 | 88 |
| 79 // If true, this object will be visible. | 89 // If true, this object will be visible. |
| 80 bool visible = true; | 90 bool visible = true; |
| 81 | 91 |
| 82 // If false, the reticle will not hit the element, even if visible. | 92 // If false, the reticle will not hit the element, even if visible. |
| 83 bool hit_testable = true; | 93 bool hit_testable = true; |
| 84 | 94 |
| 85 // If true, transformations will be applied relative to the field of view, | 95 // If true, transformations will be applied relative to the field of view, |
| 86 // rather than the world. | 96 // rather than the world. |
| 87 bool lock_to_fov = false; | 97 bool lock_to_fov = false; |
| 88 | 98 |
| 89 // If true, this element is the content quad. Only one content quad may be | |
| 90 // added to the scene. | |
| 91 bool content_quad = false; | |
| 92 | |
| 93 // Specifies the region (in pixels) of a texture to render. | 99 // Specifies the region (in pixels) of a texture to render. |
| 94 Recti copy_rect = {0, 0, 0, 0}; | 100 Recti copy_rect = {0, 0, 0, 0}; |
| 95 | 101 |
| 96 // The size of the object. This does not affect children. | 102 // The size of the object. This does not affect children. |
| 97 gvr::Vec3f size = {1.0f, 1.0f, 1.0f}; | 103 gvr::Vec3f size = {1.0f, 1.0f, 1.0f}; |
| 98 | 104 |
| 99 // The scale of the object, and its children. | 105 // The scale of the object, and its children. |
| 100 gvr::Vec3f scale = {1.0f, 1.0f, 1.0f}; | 106 gvr::Vec3f scale = {1.0f, 1.0f, 1.0f}; |
| 101 | 107 |
| 102 // The rotation of the object, and its children. | 108 // The rotation of the object, and its children. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 114 | 120 |
| 115 // If anchoring is specified, the translation will be relative to the | 121 // If anchoring is specified, the translation will be relative to the |
| 116 // specified edge(s) of the parent, rather than the center. A parent object | 122 // specified edge(s) of the parent, rather than the center. A parent object |
| 117 // must be specified when using anchoring. | 123 // must be specified when using anchoring. |
| 118 XAnchoring x_anchoring = XAnchoring::XNONE; | 124 XAnchoring x_anchoring = XAnchoring::XNONE; |
| 119 YAnchoring y_anchoring = YAnchoring::YNONE; | 125 YAnchoring y_anchoring = YAnchoring::YNONE; |
| 120 | 126 |
| 121 // Animations that affect the properties of the object over time. | 127 // Animations that affect the properties of the object over time. |
| 122 std::vector<std::unique_ptr<Animation>> animations; | 128 std::vector<std::unique_ptr<Animation>> animations; |
| 123 | 129 |
| 130 Fill fill = Fill::NONE; | |
| 131 | |
| 132 Colorf edge_color = {1.0f, 1.0f, 1.0f, 1.0f}; | |
| 133 Colorf center_color = {1.0f, 1.0f, 1.0f, 1.0f}; | |
| 134 | |
| 135 unsigned int tile_number; | |
|
cjgrant
2017/02/02 14:48:25
tile_number is confusing to me - like it's a sprit
tiborg1
2017/02/02 16:52:27
Done.
| |
| 136 | |
| 124 private: | 137 private: |
| 125 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); | 138 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); |
| 126 }; | 139 }; |
| 127 | 140 |
| 128 } // namespace vr_shell | 141 } // namespace vr_shell |
| 129 | 142 |
| 130 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 143 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
| OLD | NEW |