Skip to content

Commit

Permalink
Add a function for computing a world point from a screen point
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed May 17, 2021
1 parent 902f42b commit 96645dd
Show file tree
Hide file tree
Showing 14 changed files with 690 additions and 77 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,19 @@ path = "examples/2d/text2d.rs"
name = "texture_atlas"
path = "examples/2d/texture_atlas.rs"

[[example]]
name = "mouse_tracking"
path = "examples/2d/mouse_tracking.rs"

# 3D Rendering
[[example]]
name = "3d_scene"
path = "examples/3d/3d_scene.rs"

[[example]]
name = "screen_to_world"
path = "examples/3d/screen_to_world.rs"

[[example]]
name = "load_gltf"
path = "examples/3d/load_gltf.rs"
Expand Down
5 changes: 1 addition & 4 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ impl<'w, T: Component> Deref for Res<'w, T> {
}

impl<'w, T: Component> AsRef<T> for Res<'w, T> {
#[inline]
fn as_ref(&self) -> &T {
&*self
}
Expand Down Expand Up @@ -375,16 +374,14 @@ impl<'w, T: Component> DerefMut for ResMut<'w, T> {
}

impl<'w, T: Component> AsRef<T> for ResMut<'w, T> {
#[inline]
fn as_ref(&self) -> &T {
&*self
}
}

impl<'w, T: Component> AsMut<T> for ResMut<'w, T> {
#[inline]
fn as_mut(&mut self) -> &mut T {
self.deref_mut()
&mut *self
}
}

Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_ecs/src/world/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ impl<'a, T: core::fmt::Debug> core::fmt::Debug for Mut<'a, T> {
}

impl<'w, T> AsRef<T> for Mut<'w, T> {
#[inline]
fn as_ref(&self) -> &T {
&*self
}
}

impl<'w, T> AsMut<T> for Mut<'w, T> {
#[inline]
fn as_mut(&mut self) -> &mut T {
self.deref_mut()
&mut *self
}
}

Expand Down
15 changes: 15 additions & 0 deletions crates/bevy_geometry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "bevy_geometry"
version = "0.5.0"
authors = [
"Bevy Contributors <bevyengine@gmail.com>",
"Aevyrie Roessler <aevyrie@gmail.com>",
]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy_transform = { path = "../bevy_transform", version = "0.5.0" }
bevy_math = { path = "../bevy_math", version = "0.5.0" }
bevy_reflect = { path = "../bevy_reflect", version = "0.5.0", features = ["bevy"] }
Loading

0 comments on commit 96645dd

Please sign in to comment.