Adjusted firearm firing point forward on the m4

This commit is contained in:
Franklin 2023-11-09 00:10:13 -04:00
parent 47764f63a1
commit a98d3b8955
2 changed files with 7 additions and 7 deletions

View File

@ -15,7 +15,7 @@ impl Firearm {
Firearm::M4A1 => {
FirearmData {
firing_point: FiringPoint {
forward: 0.0,
forward: 2.5,
up: 0.0,
right: 0.0,
},

View File

@ -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<Assets<Mesh>>,
mut materials: &mut ResMut<Assets<StandardMaterial>>,
commands: &mut Commands,
meshes: &mut ResMut<Assets<Mesh>>,
materials: &mut ResMut<Assets<StandardMaterial>>,
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());