Add Asset loader, added and configured various states

This commit is contained in:
2025-07-01 12:56:31 -04:00
parent f88e615aee
commit 570ed86c4a
27 changed files with 975 additions and 803 deletions

View File

@@ -1,49 +1,49 @@
use bevy::prelude::*;
use bevy_rapier3d::prelude::GravityScale;
#[derive(Component, Default, Reflect)]
#[require(PlayerVelocity, MoveSpeed, JumpSpeed, PlayerDrag)]
pub struct PlayerMotion(pub Vec3);
#[derive(Component, Default, Reflect)]
pub struct PlayerForce(pub Vec3);
#[derive(Component, Reflect)]
#[require(GravityScale)]
pub struct GravityDirection(pub Option<Dir3>);
impl Default for GravityDirection {
fn default() -> Self {
Self::DOWN
}
}
impl GravityDirection {
pub const DOWN: GravityDirection = GravityDirection(Some(Dir3::NEG_Y));
#[allow(dead_code)]
pub const NONE: GravityDirection = GravityDirection(None);
}
#[derive(Component, Default, Reflect)]
pub struct PlayerVelocity(pub Vec3);
#[derive(Component, Reflect)]
pub struct MoveSpeed(pub f32);
impl Default for MoveSpeed {
fn default() -> Self {
Self(10.0)
}
}
#[derive(Component, Reflect)]
pub struct JumpSpeed(pub f32);
impl Default for JumpSpeed {
fn default() -> Self {
Self(10.0)
}
}
#[derive(Component, Default, Reflect)]
pub struct PlayerDrag(pub f32);
use bevy::prelude::*;
use bevy_rapier3d::prelude::GravityScale;
#[derive(Component, Default, Reflect)]
#[require(PlayerVelocity, MoveSpeed, JumpSpeed, PlayerDrag)]
pub struct PlayerMotion(pub Vec3);
#[derive(Component, Default, Reflect)]
pub struct PlayerForce(pub Vec3);
#[derive(Component, Reflect)]
#[require(GravityScale)]
pub struct GravityDirection(pub Option<Dir3>);
impl Default for GravityDirection {
fn default() -> Self {
Self::DOWN
}
}
impl GravityDirection {
pub const DOWN: GravityDirection = GravityDirection(Some(Dir3::NEG_Y));
#[allow(dead_code)]
pub const NONE: GravityDirection = GravityDirection(None);
}
#[derive(Component, Default, Reflect)]
pub struct PlayerVelocity(pub Vec3);
#[derive(Component, Reflect)]
pub struct MoveSpeed(pub f32);
impl Default for MoveSpeed {
fn default() -> Self {
Self(10.0)
}
}
#[derive(Component, Reflect)]
pub struct JumpSpeed(pub f32);
impl Default for JumpSpeed {
fn default() -> Self {
Self(10.0)
}
}
#[derive(Component, Default, Reflect)]
pub struct PlayerDrag(pub f32);