33 lines
No EOL
684 B
Rust
33 lines
No EOL
684 B
Rust
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; |