mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-10 17:18:25 -10:00
Goat head test: horizon_core's Vec3 and the goat's 15-degree head limit
The fixture kind turns heads 75 degrees; set getMaxHeadYRot's own values (15 for a goat, 75 otherwise) so the clamp is what the test measures, and use the Vec3 that Mob::new takes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
60d6008a7b
commit
38b701feb0
1 file changed
+3
-1
@@ -478,12 +478,14 @@ fn rotate_toward_max(from: f32, to: f32, max: f32) -> f32 {
|
||||
#[cfg(test)]
|
||||
mod goat_head_tests {
|
||||
use super::*;
|
||||
use glam::Vec3;
|
||||
use horizon_core::geometry::Vec3;
|
||||
use std::sync::Arc;
|
||||
|
||||
fn mob(species: Species) -> Mob {
|
||||
let mut kind = (*crate::mobs::sensor_scan_tests::kind()).clone();
|
||||
kind.species = species;
|
||||
// Mob.getMaxHeadYRot: 15 for a goat (Goat.getMaxHeadYRot), 75 otherwise.
|
||||
kind.max_head_y_rot = if species == Species::Goat { 15.0 } else { 75.0 };
|
||||
Mob::new(1, Arc::new(kind), Vec3::ZERO, 0.0)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user