mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Baby striders and turtles: pin their shadow radius
The age-scaled radius was implemented but untested; a regression in the age table or the renderer's extra factor would go unnoticed.
This commit is contained in:
1 parent
7e6cbea1a3
commit
5299166ad0
1 file changed
+8
@@ -370,6 +370,14 @@ mod tests {
|
||||
goat.extra.age = -24000;
|
||||
// Goat.getAgeScale: 0.55.
|
||||
assert_eq!(mob_shadow_radius(&goat), 0.7 * 0.55);
|
||||
let mut strider = mob("minecraft:strider", S::Strider);
|
||||
strider.extra.age = -24000;
|
||||
// StriderRenderer halves AgeableMobRenderer's 0.5 * 0.5 again.
|
||||
assert_eq!(mob_shadow_radius(&strider), 0.125);
|
||||
let mut turtle = mob("minecraft:turtle", S::Turtle);
|
||||
turtle.extra.age = -24000;
|
||||
// TurtleRenderer takes 0.83 of the 0.7 * 0.3 age-scaled radius.
|
||||
assert!((mob_shadow_radius(&turtle) - 0.7 * 0.3 * 0.83).abs() < 1e-6);
|
||||
}
|
||||
#[test]
|
||||
fn scaled_players_cast_a_scaled_shadow() {
|
||||
|
||||
Reference in new issue
Block a user