diff --git a/Cargo.toml b/Cargo.toml index 161af1a..877da91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,3 +44,15 @@ opt-level = 3 [profile.release] codegen-units = 1 +lto = "thin" + + +# Optimize for build time in CI. +[profile.ci] +inherits = "dev" +opt-level = 0 +debug = "line-tables-only" +codegen-units = 4 + +[profile.ci.package."*"] +opt-level = 0 diff --git a/src/plugins/player.rs b/src/plugins/player.rs index e6e8c56..198ed08 100644 --- a/src/plugins/player.rs +++ b/src/plugins/player.rs @@ -1,4 +1,4 @@ -use std::f32::{EPSILON, consts::FRAC_PI_2}; +use std::f32::consts::FRAC_PI_2; use bevy::{input::mouse::MouseMotion, prelude::*}; use bevy_rapier3d::prelude::*; @@ -55,7 +55,7 @@ fn apply_gravity( vel.0 += grav * scale.0 * 9.47 * time.delta_secs(); } else { let dot = vel.0.dot(grav); - if dot > EPSILON { + if dot > f32::EPSILON { vel.0 -= dot * grav; } } diff --git a/src/utils/rotation.rs b/src/utils/rotation.rs index 10595f0..39e25ae 100644 --- a/src/utils/rotation.rs +++ b/src/utils/rotation.rs @@ -1,4 +1,4 @@ -use std::f32::{EPSILON, consts::PI}; +use std::f32::consts::PI; use bevy::prelude::*; @@ -6,7 +6,7 @@ pub fn get_alignment_rotation(cur_dir: Dir3, target_dir: Vec3) -> Quat { let tgt = target_dir.normalize(); let axis = cur_dir.cross(tgt); let axis_len = axis.length(); - if axis_len < EPSILON { + if axis_len < f32::EPSILON { let dot = cur_dir.dot(tgt); if dot > 0.999 { return Quat::IDENTITY;