@@ -51,6 +51,8 @@ impl Plugin for CursorInfoPlugin {
51
51
/// /* ... */
52
52
/// }
53
53
/// ```
54
+ ///
55
+ /// [`SystemSet`]: https://docs.rs/bevy/0.11.0/bevy/ecs/schedule/trait.SystemSet.html
54
56
#[ derive( SystemSet , Hash , Debug , PartialEq , Eq , Clone , Copy ) ]
55
57
pub struct UpdateCursorInfo ;
56
58
@@ -80,18 +82,29 @@ pub struct CursorInfo(Option<CursorData>);
80
82
#[ derive( Debug , Clone , PartialEq ) ]
81
83
pub struct CursorData {
82
84
/// The position of the cursor in the world.
85
+ ///
86
+ /// See [`Camera::viewport_to_world_2d`].
87
+ ///
88
+ /// [`Camera::viewport_to_world_2d`]: https://docs.rs/bevy/0.11.0/bevy/render/camera/struct.Camera.html#method.viewport_to_world_2d
83
89
#[ cfg( feature = "2d" ) ]
84
90
pub position : Vec2 ,
85
91
/// The [`Ray`] emitted by the cursor from the camera.
92
+ ///
93
+ /// See [`Camera::viewport_to_world`].
94
+ ///
95
+ /// [`Ray`]: https://docs.rs/bevy/0.11.0/bevy/math/struct.Ray.html
96
+ /// [`Camera::viewport_to_world`]: https://docs.rs/bevy/0.11.0/bevy/render/camera/struct.Camera.html#method.viewport_to_world
86
97
#[ cfg( feature = "3d" ) ]
87
98
pub ray : Ray ,
88
99
/// The cursor position in the window in logical pixels.
89
100
///
90
- /// See [`cursor_position`](Window::cursor_position()).
101
+ /// See [`Window::cursor_position`].
102
+ ///
103
+ /// [`Window::cursor_position`]: https://docs.rs/bevy/0.11.0/bevy/window/struct.Window.html#method.cursor_position
91
104
pub window_position : Vec2 ,
92
- /// The [`Entity`] of the window that contains the cursor.
105
+ /// The entity id of the window that contains the cursor.
93
106
pub window : Entity ,
94
- /// The [`Entity`] of the camera used to compute the world position of the cursor.
107
+ /// The entity id of the camera used to compute the world position of the cursor.
95
108
pub camera : Entity ,
96
109
}
97
110
@@ -106,9 +119,11 @@ impl CursorInfo {
106
119
107
120
/// The position of the cursor in the world.
108
121
///
109
- /// See [`Camera::viewport_to_world_2d`](Camera::viewport_to_world_2d) .
122
+ /// See [`Camera::viewport_to_world_2d`].
110
123
///
111
124
/// The value is `None` if the cursor is not in any window.
125
+ ///
126
+ /// [`Camera::viewport_to_world_2d`]: https://docs.rs/bevy/0.11.0/bevy/render/camera/struct.Camera.html#method.viewport_to_world_2d
112
127
#[ cfg( feature = "2d" ) ]
113
128
#[ inline]
114
129
pub fn position ( & self ) -> Option < Vec2 > {
@@ -117,9 +132,12 @@ impl CursorInfo {
117
132
118
133
/// The [`Ray`] emitted by the cursor from the camera.
119
134
///
120
- /// See [`Camera::viewport_to_world`](Camera::viewport_to_world) .
135
+ /// See [`Camera::viewport_to_world`].
121
136
///
122
137
/// The value is `None` if the cursor is not in any window.
138
+ ///
139
+ /// [`Ray`]: https://docs.rs/bevy/0.11.0/bevy/math/struct.Ray.html
140
+ /// [`Camera::viewport_to_world`]: https://docs.rs/bevy/0.11.0/bevy/render/camera/struct.Camera.html#method.viewport_to_world
123
141
#[ cfg( feature = "3d" ) ]
124
142
#[ inline]
125
143
pub fn ray ( & self ) -> Option < Ray > {
@@ -128,23 +146,25 @@ impl CursorInfo {
128
146
129
147
/// The cursor position in the window in logical pixels.
130
148
///
131
- /// See [`cursor_position`]( Window::cursor_position()) .
149
+ /// See [`Window::cursor_position`] .
132
150
///
133
151
/// The value is `None` if the cursor is not in any window.
152
+ ///
153
+ /// [`Window::cursor_position`]: https://docs.rs/bevy/0.11.0/bevy/window/struct.Window.html#method.cursor_position
134
154
#[ inline]
135
155
pub fn window_position ( & self ) -> Option < Vec2 > {
136
156
self . get ( ) . map ( |data| data. window_position )
137
157
}
138
158
139
- /// The [`Entity`] of the window that contains the cursor.
159
+ /// The entity id of the window that contains the cursor.
140
160
///
141
161
/// The value is `None` if the cursor is not in any window.
142
162
#[ inline]
143
163
pub fn window ( & self ) -> Option < Entity > {
144
164
self . get ( ) . map ( |data| data. window )
145
165
}
146
166
147
- /// The [`Entity`] of the camera used to compute the world position of the cursor.
167
+ /// The entity id of the camera used to compute the world position of the cursor.
148
168
///
149
169
/// The value is `None` if the cursor is not in any window.
150
170
#[ inline]
0 commit comments