update to bevy_spatial 0.10

This commit is contained in:
Joe Ardent 2024-12-05 08:51:03 -08:00
parent 6f6b2aa360
commit 9225408422
3 changed files with 4 additions and 3 deletions

3
Cargo.lock generated
View file

@ -1041,7 +1041,8 @@ dependencies = [
[[package]] [[package]]
name = "bevy_spatial" name = "bevy_spatial"
version = "0.10.0" version = "0.10.0"
source = "git+https://github.com/laundmo/bevy-spatial.git?rev=9ac313ac6173b440f50954b696dc2063513b4f37#9ac313ac6173b440f50954b696dc2063513b4f37" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce9d7e0f0b55570cb0d059542787fa22300db805dbb0ebc5e9172ca5c1bd48dc"
dependencies = [ dependencies = [
"bevy", "bevy",
"kd-tree", "kd-tree",

View file

@ -9,5 +9,5 @@ gizmos = []
[dependencies] [dependencies]
argh = "0.1" argh = "0.1"
bevy = "0.15" bevy = "0.15"
bevy_spatial = { git = "https://github.com/laundmo/bevy-spatial.git", rev = "9ac313ac6173b440f50954b696dc2063513b4f37" } #"0.10.0" bevy_spatial = "0.10"
rand = "0.8" rand = "0.8"

View file

@ -111,7 +111,7 @@ pub fn update_vel(
let bdir = *bp - pos; let bdir = *bp - pos;
let dist = bdir.length(); let dist = bdir.length();
let rot = Quat::from_rotation_arc(dir, bdir.normalize()); let rot = Quat::from_rotation_arc(dir, bdir.normalize());
let s = (dist / (BUDDY_RADIUS * 1.2)).min(1.0); let s = (dist / (BUDDY_RADIUS)).min(1.0);
let rot = Quat::IDENTITY.slerp(rot, s); let rot = Quat::IDENTITY.slerp(rot, s);
dir = rot.mul_vec3(dir).normalize(); dir = rot.mul_vec3(dir).normalize();
} }