fix plugin shit
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
use asset_loading::ImageAssets;
|
use asset_loading::ImageAssets;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use physics_plugin::PhysicsPlugin;
|
|
||||||
|
|
||||||
mod asset_loading;
|
mod asset_loading;
|
||||||
mod bevy_plugin;
|
mod bevy_plugin;
|
||||||
mod level_instantiation;
|
mod level_instantiation;
|
||||||
mod main_menu;
|
mod main_menu;
|
||||||
mod physics_plugin;
|
mod physics;
|
||||||
mod player;
|
mod player;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -14,9 +13,9 @@ fn main() {
|
|||||||
.add_plugins((
|
.add_plugins((
|
||||||
bevy_plugin::plugin,
|
bevy_plugin::plugin,
|
||||||
asset_loading::plugin,
|
asset_loading::plugin,
|
||||||
player::plugin,
|
physics::plugin,
|
||||||
PhysicsPlugin,
|
|
||||||
level_instantiation::map_plugin,
|
level_instantiation::map_plugin,
|
||||||
|
player::plugin,
|
||||||
main_menu::plugin,
|
main_menu::plugin,
|
||||||
))
|
))
|
||||||
.init_state::<GameState>()
|
.init_state::<GameState>()
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ pub struct PreviousPhysicalTranslation(pub Vec3);
|
|||||||
#[derive(Debug, Component, Clone, Copy, PartialEq, Default, Deref, DerefMut)]
|
#[derive(Debug, Component, Clone, Copy, PartialEq, Default, Deref, DerefMut)]
|
||||||
pub struct AccumulatedInput(pub Vec3);
|
pub struct AccumulatedInput(pub Vec3);
|
||||||
|
|
||||||
pub struct PhysicsPlugin;
|
pub fn plugin(app: &mut App) {
|
||||||
impl Plugin for PhysicsPlugin {
|
app.add_systems(
|
||||||
fn build(&self, app: &mut App) {
|
RunFixedMainLoop,
|
||||||
app.add_systems(RunFixedMainLoop, interpolate_rendered_transform.in_set(RunFixedMainLoopSystem::AfterFixedMainLoop))
|
interpolate_rendered_transform.in_set(RunFixedMainLoopSystem::AfterFixedMainLoop),
|
||||||
|
)
|
||||||
.add_systems(FixedUpdate, step);
|
.add_systems(FixedUpdate, step);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn interpolate_rendered_transform(
|
pub fn interpolate_rendered_transform(
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
GameState,
|
GameState,
|
||||||
physics_plugin::{
|
physics::{AccumulatedInput, PhysicalTranslation, PreviousPhysicalTranslation, Velocity},
|
||||||
AccumulatedInput, PhysicalTranslation, PreviousPhysicalTranslation, Velocity,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use bevy::{
|
use bevy::{
|
||||||
input::mouse::AccumulatedMouseMotion, pbr::NotShadowCaster, prelude::*,
|
input::mouse::AccumulatedMouseMotion, pbr::NotShadowCaster, prelude::*,
|
||||||
|
|||||||
Reference in New Issue
Block a user