Skip to content

Commit 7b61246

Browse files
committed
Add a function for computing a world point from a screen point
1 parent 50c74e5 commit 7b61246

File tree

14 files changed

+690
-72
lines changed

14 files changed

+690
-72
lines changed

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,19 @@ path = "examples/2d/text2d.rs"
125125
name = "texture_atlas"
126126
path = "examples/2d/texture_atlas.rs"
127127

128+
[[example]]
129+
name = "mouse_tracking"
130+
path = "examples/2d/mouse_tracking.rs"
131+
128132
# 3D Rendering
129133
[[example]]
130134
name = "3d_scene"
131135
path = "examples/3d/3d_scene.rs"
132136

137+
[[example]]
138+
name = "screen_to_world"
139+
path = "examples/3d/screen_to_world.rs"
140+
133141
[[example]]
134142
name = "load_gltf"
135143
path = "examples/3d/load_gltf.rs"

crates/bevy_ecs/src/system/system_param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl<'w, T: Component> AsRef<T> for ResMut<'w, T> {
381381

382382
impl<'w, T: Component> AsMut<T> for ResMut<'w, T> {
383383
fn as_mut(&mut self) -> &mut T {
384-
self.deref_mut()
384+
&mut *self
385385
}
386386
}
387387

crates/bevy_ecs/src/world/pointer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<'w, T> AsRef<T> for Mut<'w, T> {
4747

4848
impl<'w, T> AsMut<T> for Mut<'w, T> {
4949
fn as_mut(&mut self) -> &mut T {
50-
self.deref_mut()
50+
&mut *self
5151
}
5252
}
5353

crates/bevy_geometry/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "bevy_geometry"
3+
version = "0.5.0"
4+
authors = [
5+
"Bevy Contributors <[email protected]>",
6+
"Aevyrie Roessler <[email protected]>",
7+
]
8+
edition = "2018"
9+
10+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11+
12+
[dependencies]
13+
bevy_transform = { path = "../bevy_transform", version = "0.5.0" }
14+
bevy_math = { path = "../bevy_math", version = "0.5.0" }
15+
bevy_reflect = { path = "../bevy_reflect", version = "0.5.0", features = ["bevy"] }

0 commit comments

Comments
 (0)