From a98d3b895574d827074e5bfde8d085430b1afe30 Mon Sep 17 00:00:00 2001 From: Franklin Date: Thu, 9 Nov 2023 00:10:13 -0400 Subject: [PATCH] Adjusted firearm firing point forward on the m4 --- src/logic/core/guns/firearm.rs | 2 +- src/logic/core/guns/shoot.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/logic/core/guns/firearm.rs b/src/logic/core/guns/firearm.rs index 7863b92..cb43d4c 100644 --- a/src/logic/core/guns/firearm.rs +++ b/src/logic/core/guns/firearm.rs @@ -15,7 +15,7 @@ impl Firearm { Firearm::M4A1 => { FirearmData { firing_point: FiringPoint { - forward: 0.0, + forward: 2.5, up: 0.0, right: 0.0, }, diff --git a/src/logic/core/guns/shoot.rs b/src/logic/core/guns/shoot.rs index 1d2c2bc..1128ed1 100644 --- a/src/logic/core/guns/shoot.rs +++ b/src/logic/core/guns/shoot.rs @@ -7,17 +7,17 @@ use crate::comps::core::markers::muzzle_flash::MuzzleFlashMarker; use super::caliber::Caliber; pub fn shoot_bullet( - mut commands: &mut Commands, - mut meshes: &mut ResMut>, - mut materials: &mut ResMut>, + commands: &mut Commands, + meshes: &mut ResMut>, + materials: &mut ResMut>, firing_point: Transform, forward: Vec3, - up: Vec3, + _up: Vec3, caliber: Caliber ) { //let transform = Transform::from_translation(firing_point).look_at(target, up) // Spawn muzzle flash LIGHT - /*commands.spawn( + commands.spawn( (PointLightBundle { point_light: PointLight { //252, 238, 128 @@ -31,7 +31,7 @@ pub fn shoot_bullet( visibility: Visibility::Visible, ..Default::default() }, MuzzleFlashMarker(Timer::new(Duration::from_millis(10), TimerMode::Once))) - );*/ + ); println!("origin: {}", firing_point.translation); println!("end: {}", firing_point.forward() * caliber.range());