Adjusted firearm firing point forward on the m4
This commit is contained in:
parent
47764f63a1
commit
a98d3b8955
@ -15,7 +15,7 @@ impl Firearm {
|
|||||||
Firearm::M4A1 => {
|
Firearm::M4A1 => {
|
||||||
FirearmData {
|
FirearmData {
|
||||||
firing_point: FiringPoint {
|
firing_point: FiringPoint {
|
||||||
forward: 0.0,
|
forward: 2.5,
|
||||||
up: 0.0,
|
up: 0.0,
|
||||||
right: 0.0,
|
right: 0.0,
|
||||||
},
|
},
|
||||||
|
@ -7,17 +7,17 @@ use crate::comps::core::markers::muzzle_flash::MuzzleFlashMarker;
|
|||||||
use super::caliber::Caliber;
|
use super::caliber::Caliber;
|
||||||
|
|
||||||
pub fn shoot_bullet(
|
pub fn shoot_bullet(
|
||||||
mut commands: &mut Commands,
|
commands: &mut Commands,
|
||||||
mut meshes: &mut ResMut<Assets<Mesh>>,
|
meshes: &mut ResMut<Assets<Mesh>>,
|
||||||
mut materials: &mut ResMut<Assets<StandardMaterial>>,
|
materials: &mut ResMut<Assets<StandardMaterial>>,
|
||||||
firing_point: Transform,
|
firing_point: Transform,
|
||||||
forward: Vec3,
|
forward: Vec3,
|
||||||
up: Vec3,
|
_up: Vec3,
|
||||||
caliber: Caliber
|
caliber: Caliber
|
||||||
) {
|
) {
|
||||||
//let transform = Transform::from_translation(firing_point).look_at(target, up)
|
//let transform = Transform::from_translation(firing_point).look_at(target, up)
|
||||||
// Spawn muzzle flash LIGHT
|
// Spawn muzzle flash LIGHT
|
||||||
/*commands.spawn(
|
commands.spawn(
|
||||||
(PointLightBundle {
|
(PointLightBundle {
|
||||||
point_light: PointLight {
|
point_light: PointLight {
|
||||||
//252, 238, 128
|
//252, 238, 128
|
||||||
@ -31,7 +31,7 @@ pub fn shoot_bullet(
|
|||||||
visibility: Visibility::Visible,
|
visibility: Visibility::Visible,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}, MuzzleFlashMarker(Timer::new(Duration::from_millis(10), TimerMode::Once)))
|
}, MuzzleFlashMarker(Timer::new(Duration::from_millis(10), TimerMode::Once)))
|
||||||
);*/
|
);
|
||||||
|
|
||||||
println!("origin: {}", firing_point.translation);
|
println!("origin: {}", firing_point.translation);
|
||||||
println!("end: {}", firing_point.forward() * caliber.range());
|
println!("end: {}", firing_point.forward() * caliber.range());
|
||||||
|
Loading…
Reference in New Issue
Block a user