Profiles and workflow
This commit is contained in:
12
Cargo.toml
12
Cargo.toml
@@ -44,3 +44,15 @@ opt-level = 3
|
|||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
codegen-units = 1
|
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
|
||||||
|
|||||||
@@ -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::{input::mouse::MouseMotion, prelude::*};
|
||||||
use bevy_rapier3d::prelude::*;
|
use bevy_rapier3d::prelude::*;
|
||||||
@@ -55,7 +55,7 @@ fn apply_gravity(
|
|||||||
vel.0 += grav * scale.0 * 9.47 * time.delta_secs();
|
vel.0 += grav * scale.0 * 9.47 * time.delta_secs();
|
||||||
} else {
|
} else {
|
||||||
let dot = vel.0.dot(grav);
|
let dot = vel.0.dot(grav);
|
||||||
if dot > EPSILON {
|
if dot > f32::EPSILON {
|
||||||
vel.0 -= dot * grav;
|
vel.0 -= dot * grav;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::f32::{EPSILON, consts::PI};
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
use bevy::prelude::*;
|
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 tgt = target_dir.normalize();
|
||||||
let axis = cur_dir.cross(tgt);
|
let axis = cur_dir.cross(tgt);
|
||||||
let axis_len = axis.length();
|
let axis_len = axis.length();
|
||||||
if axis_len < EPSILON {
|
if axis_len < f32::EPSILON {
|
||||||
let dot = cur_dir.dot(tgt);
|
let dot = cur_dir.dot(tgt);
|
||||||
if dot > 0.999 {
|
if dot > 0.999 {
|
||||||
return Quat::IDENTITY;
|
return Quat::IDENTITY;
|
||||||
|
|||||||
Reference in New Issue
Block a user