diff options
| -rw-r--r-- | azalea-core/src/math.rs | 6 | ||||
| -rw-r--r-- | azalea-physics/src/lib.rs | 15 |
2 files changed, 6 insertions, 15 deletions
diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index 40d147e4..6683dd10 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -1,9 +1,9 @@ -use std::sync::LazyLock; +use std::{f64::consts::PI, sync::LazyLock}; pub static SIN: LazyLock<[f32; 65536]> = LazyLock::new(|| { let mut sin = [0.0; 65536]; - for i in 0..65536 { - sin[i] = f64::sin((i as f64) * 3.141592653589793 * 2.0 / 65536.0) as f32; + for (i, item) in sin.iter_mut().enumerate() { + *item = f64::sin((i as f64) * PI * 2.0 / 65536.0) as f32; } sin }); diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index cad1c15f..06138cf7 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -11,17 +11,13 @@ use azalea_entity::{ Position, }; use azalea_world::{Instance, InstanceContainer, InstanceName}; -use bevy_app::{App, FixedUpdate, Plugin, Update}; +use bevy_app::{App, FixedUpdate, Plugin}; use bevy_ecs::{ - entity::Entity, - event::{EventReader, EventWriter}, - prelude::Event, query::With, schedule::{IntoSystemConfigs, SystemSet}, system::{Query, Res}, }; use collision::{move_colliding, MoverType}; -use log::trace; /// A Bevy [`SystemSet`] for running physics that makes entities do things. #[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone)] @@ -36,6 +32,7 @@ impl Plugin for PhysicsPlugin { /// Move the entity with the given acceleration while handling friction, /// gravity, collisions, and some other stuff. +#[allow(clippy::type_complexity)] fn travel( mut query: Query< ( @@ -118,6 +115,7 @@ fn travel( /// applies air resistance, calls self.travel(), and some other random /// stuff. +#[allow(clippy::type_complexity)] pub fn ai_step( mut query: Query< ( @@ -133,13 +131,6 @@ pub fn ai_step( // With<LocalPlayerInLoadedChunk> maybe there should be an InLoadedChunk/InUnloadedChunk // component? >, - // mut jump_query: Query<( - // &mut Physics, - // &Position, - // &LookDirection, - // &Sprinting, - // &InstanceName, - // )>, instance_container: Res<InstanceContainer>, ) { for (mut physics, jumping, position, look_direction, sprinting, instance_name) in &mut query { |
