factor ou projectile components and systems
This commit is contained in:
parent
eeebdbd272
commit
67ddcb0c65
6 changed files with 426 additions and 293 deletions
33
src/states/linear/components_projectile.rs
Normal file
33
src/states/linear/components_projectile.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use bevy::math::Vec2;
|
||||
use bevy::prelude::Component;
|
||||
use crate::states::linear::RoundBallType;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct RoundBallProjectile {
|
||||
pub velocity: Vec2,
|
||||
pub direction: Vec2,
|
||||
pub previous_position: Vec2,
|
||||
pub ball_type: RoundBallType,
|
||||
pub hit_result: Option<ProjectileHit>,
|
||||
pub target_position: Option<Vec2>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct ProjectileHit {
|
||||
pub hit_progress: f32,
|
||||
pub hit_position: Vec2,
|
||||
pub segment_index: usize,
|
||||
}
|
||||
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct IntersectMarker;
|
||||
|
||||
pub struct Intersection {
|
||||
pub t: f32,
|
||||
pub world_pos: Vec2,
|
||||
pub segment_index: usize,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct InsertMarker;
|
||||
Loading…
Add table
Add a link
Reference in a new issue