Skip to content

Instantly share code, notes, and snippets.

@pjalaber
Created January 24, 2022 16:46
Show Gist options
  • Save pjalaber/f43979121cad518cbcb95e960a70678a to your computer and use it in GitHub Desktop.
Save pjalaber/f43979121cad518cbcb95e960a70678a to your computer and use it in GitHub Desktop.
diff --git a/examples/mouse_picking.rs b/examples/mouse_picking.rs
index 3224c44..ce0796e 100644
--- a/examples/mouse_picking.rs
+++ b/examples/mouse_picking.rs
@@ -60,12 +60,16 @@ fn setup(
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
+ let translation = Vec3::new(10.0, 6.0, -0.6);
// Overwrite the default plugin state with one that enables the debug cursor. This line can be
// removed if the debug cursor isn't needed as the state is set to default values when the
// default plugin is added.
commands.insert_resource(DefaultPluginState::<MyRaycastSet>::default().with_debug_cursor());
commands
- .spawn_bundle(PerspectiveCameraBundle::default())
+ .spawn_bundle(PerspectiveCameraBundle{
+ transform: Transform::from_translation(translation).looking_at(Vec3::ZERO, Vec3::Y),
+ ..Default::default()
+ })
.insert(RayCastSource::<MyRaycastSet>::new()); // Designate the camera as our source
commands
.spawn_bundle(PbrBundle {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment