Skip to content

Commit c7cee10

Browse files
committed
workaround to link to bevy type
see rust-lang/docs.rs#1588
1 parent 7dcd317 commit c7cee10

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

src/lib.rs

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ impl Plugin for CursorInfoPlugin {
5151
/// /* ... */
5252
/// }
5353
/// ```
54+
///
55+
/// [`SystemSet`]: https://docs.rs/bevy/0.11.0/bevy/ecs/schedule/trait.SystemSet.html
5456
#[derive(SystemSet, Hash, Debug, PartialEq, Eq, Clone, Copy)]
5557
pub struct UpdateCursorInfo;
5658

@@ -80,18 +82,29 @@ pub struct CursorInfo(Option<CursorData>);
8082
#[derive(Debug, Clone, PartialEq)]
8183
pub struct CursorData {
8284
/// 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
8389
#[cfg(feature = "2d")]
8490
pub position: Vec2,
8591
/// 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
8697
#[cfg(feature = "3d")]
8798
pub ray: Ray,
8899
/// The cursor position in the window in logical pixels.
89100
///
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
91104
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.
93106
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.
95108
pub camera: Entity,
96109
}
97110

@@ -106,9 +119,11 @@ impl CursorInfo {
106119

107120
/// The position of the cursor in the world.
108121
///
109-
/// See [`Camera::viewport_to_world_2d`](Camera::viewport_to_world_2d).
122+
/// See [`Camera::viewport_to_world_2d`].
110123
///
111124
/// 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
112127
#[cfg(feature = "2d")]
113128
#[inline]
114129
pub fn position(&self) -> Option<Vec2> {
@@ -117,9 +132,12 @@ impl CursorInfo {
117132

118133
/// The [`Ray`] emitted by the cursor from the camera.
119134
///
120-
/// See [`Camera::viewport_to_world`](Camera::viewport_to_world).
135+
/// See [`Camera::viewport_to_world`].
121136
///
122137
/// 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
123141
#[cfg(feature = "3d")]
124142
#[inline]
125143
pub fn ray(&self) -> Option<Ray> {
@@ -128,23 +146,25 @@ impl CursorInfo {
128146

129147
/// The cursor position in the window in logical pixels.
130148
///
131-
/// See [`cursor_position`](Window::cursor_position()).
149+
/// See [`Window::cursor_position`].
132150
///
133151
/// 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
134154
#[inline]
135155
pub fn window_position(&self) -> Option<Vec2> {
136156
self.get().map(|data| data.window_position)
137157
}
138158

139-
/// The [`Entity`] of the window that contains the cursor.
159+
/// The entity id of the window that contains the cursor.
140160
///
141161
/// The value is `None` if the cursor is not in any window.
142162
#[inline]
143163
pub fn window(&self) -> Option<Entity> {
144164
self.get().map(|data| data.window)
145165
}
146166

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.
148168
///
149169
/// The value is `None` if the cursor is not in any window.
150170
#[inline]

0 commit comments

Comments
 (0)