WIP prefabs loader
This commit is contained in:
50
game/main/src/components/camera.rs
Normal file
50
game/main/src/components/camera.rs
Normal file
@@ -0,0 +1,50 @@
|
||||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component, Reflect)]
|
||||
pub struct FreeCam(pub bool);
|
||||
|
||||
#[derive(Component, Default, Reflect)]
|
||||
pub struct MainCamera;
|
||||
|
||||
#[derive(Component, Default, Reflect)]
|
||||
pub struct CameraRoot;
|
||||
#[derive(Component, Default, Reflect)]
|
||||
pub struct CameraPitch(pub f32);
|
||||
#[derive(Component, Reflect)]
|
||||
pub struct Unfocused;
|
||||
|
||||
#[derive(Component, Reflect)]
|
||||
#[require(FollowTarget)]
|
||||
pub struct FollowCam {
|
||||
pub target: Entity,
|
||||
pub distance: f32,
|
||||
pub height: f32,
|
||||
}
|
||||
|
||||
#[derive(Component, Reflect)]
|
||||
pub struct FollowTarget {
|
||||
pub pos: Vec3,
|
||||
pub rot: Quat,
|
||||
pub up: Dir3,
|
||||
}
|
||||
|
||||
impl Default for FollowTarget {
|
||||
fn default() -> Self {
|
||||
return Self {
|
||||
pos: default(),
|
||||
rot: default(),
|
||||
up: Dir3::Y,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Component, Default, Reflect)]
|
||||
pub enum CameraMode {
|
||||
#[default]
|
||||
Player,
|
||||
Ship,
|
||||
Disabled,
|
||||
}
|
||||
|
||||
#[derive(Component, Reflect)]
|
||||
pub struct CameraAttachment(pub Entity);
|
||||
Reference in New Issue
Block a user