Match vanilla entity model poses on every compared layer
The warden's walk, idle wobble and pulsating spots now use Mth's sine table as WardenModel and WardenRenderer do, and baby sniffers no longer apply SnifferAnimation.BABY_TRANSFORM: SnifferRenderer wraps the baby geometry in a plain SnifferModel, so that animation never runs in 26.3. The harness now drives the illusioner through explicit arm poses like the other illagers, and the oracle shows its hat as IllusionerRenderer does. All 132 compared layers match over 3,876 cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -406,7 +406,7 @@ fn main() -> horizon_client::Result<()> {
|
||||
num("ticksUsingItem"),
|
||||
);
|
||||
}
|
||||
Species::Evoker | Species::Pillager | Species::Vindicator => {
|
||||
Species::Evoker | Species::Illusioner | Species::Pillager | Species::Vindicator => {
|
||||
use horizon_client::mobs::illager::{ArmPose, anim_pose};
|
||||
let pose = match case["armPose"].as_str() {
|
||||
Some("CROSSED") => ArmPose::Crossed,
|
||||
|
||||
@@ -630,11 +630,8 @@ pub fn anim(m: &Mob, s: &State, p: &mut Poses, animations: &HashMap<String, Anim
|
||||
a.apply(ms, 1.0, p);
|
||||
}
|
||||
}
|
||||
if m.is_baby()
|
||||
&& let Some(a) = get("BABY_TRANSFORM")
|
||||
{
|
||||
a.apply(0, 1.0, p);
|
||||
}
|
||||
// The baby layer is SniffletModel geometry, but SnifferRenderer wraps it
|
||||
// in a plain SnifferModel, so SnifferAnimation.BABY_TRANSFORM never runs.
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
@@ -11,7 +11,10 @@ use super::{
|
||||
path::{Path, PathType},
|
||||
};
|
||||
use crate::sculk::{self, Context, Info};
|
||||
use horizon_core::{geometry::Vec3, random::RandomSource};
|
||||
use horizon_core::{
|
||||
geometry::{Vec3, trig::Mth},
|
||||
random::RandomSource,
|
||||
};
|
||||
use std::{collections::HashMap, f32::consts::PI};
|
||||
|
||||
pub const EMERGE_DURATION: i64 = 134;
|
||||
@@ -1472,16 +1475,16 @@ pub fn anim(m: &Mob, s: &State, p: &mut Poses, animations: &HashMap<String, Anim
|
||||
// animateWalk
|
||||
let speed_modifier = (3.0 * s.speed).min(0.5);
|
||||
let adjusted = s.pos * 0.8662;
|
||||
let (cos, sin) = (adjusted.cos(), adjusted.sin());
|
||||
let (cos, sin) = (adjusted.mcos(), adjusted.msin());
|
||||
let speed_min = speed_modifier.min(0.35);
|
||||
let head_z = p.get("head")[5] + 0.3 * sin * speed_modifier;
|
||||
p.zrot("head", head_z);
|
||||
let head_x = p.get("head")[3] + 1.2 * (adjusted + PI / 2.0).cos() * speed_min;
|
||||
let head_x = p.get("head")[3] + 1.2 * (adjusted + PI / 2.0).mcos() * speed_min;
|
||||
p.xrot("head", head_x);
|
||||
p.zrot("body", 0.1 * sin * speed_modifier);
|
||||
p.xrot("body", cos * speed_min);
|
||||
p.xrot("left_leg", cos * speed_modifier);
|
||||
p.xrot("right_leg", (adjusted + PI).cos() * speed_modifier);
|
||||
p.xrot("right_leg", (adjusted + PI).mcos() * speed_modifier);
|
||||
p.xrot("left_arm", -(0.8 * cos * speed_modifier));
|
||||
p.zrot("left_arm", 0.0);
|
||||
p.xrot("right_arm", -(0.8 * sin * speed_modifier));
|
||||
@@ -1495,7 +1498,7 @@ pub fn anim(m: &Mob, s: &State, p: &mut Poses, animations: &HashMap<String, Anim
|
||||
}
|
||||
// animateIdlePose
|
||||
let scaled = s.age * 0.1;
|
||||
let (wobble_cos, wobble_sin) = (scaled.cos(), scaled.sin());
|
||||
let (wobble_cos, wobble_sin) = (scaled.mcos(), scaled.msin());
|
||||
let head_z = p.get("head")[5] + 0.06 * wobble_cos;
|
||||
p.zrot("head", head_z);
|
||||
let head_x = p.get("head")[3] + 0.06 * wobble_sin;
|
||||
@@ -1538,12 +1541,12 @@ pub fn emissive_layers(m: &Mob, partial: f32) -> [(&'static str, &'static str, f
|
||||
(
|
||||
"warden#pulsating_spots",
|
||||
"entity/warden/warden_pulsating_spots_1",
|
||||
((age * 0.045).cos() * 0.25).max(0.0),
|
||||
((age * 0.045).mcos() * 0.25).max(0.0),
|
||||
),
|
||||
(
|
||||
"warden#pulsating_spots",
|
||||
"entity/warden/warden_pulsating_spots_2",
|
||||
((age * 0.045 + PI).cos() * 0.25).max(0.0),
|
||||
((age * 0.045 + PI).mcos() * 0.25).max(0.0),
|
||||
),
|
||||
(
|
||||
"warden#tendrils",
|
||||
|
||||
@@ -174,6 +174,8 @@ public final class VanillaEntityAnimOracle {
|
||||
var cls = findClass(head[1]);
|
||||
var baked = roots.get(location).bakeRoot();
|
||||
var model = (net.minecraft.client.model.Model<EntityRenderState>) cls.getConstructor(ModelPart.class).newInstance(baked);
|
||||
// IllusionerRenderer shows the hat IllagerModel hides.
|
||||
if (layer.equals("minecraft:illusioner#main")) ((net.minecraft.client.model.monster.illager.IllagerModel<?>) (Object) model).getHat().visible = true;
|
||||
var type = stateClass(cls);
|
||||
var state = (EntityRenderState) type.getDeclaredConstructor().newInstance();
|
||||
state.getClass();
|
||||
|
||||
@@ -157,7 +157,7 @@ SPECIES = {
|
||||
'piglin': PIGLIN, 'piglin_brute': PIGLIN,
|
||||
'cat': FELINE, 'ocelot': FELINE,
|
||||
'creaking': [{'canMove': F}, {'attackAnimationState': 2}, {'invulnerabilityAnimationState': 3}, {'deathAnimationState': 1}],
|
||||
'evoker': ILLAGER, 'pillager': ILLAGER, 'vindicator': ILLAGER,
|
||||
'evoker': ILLAGER, 'pillager': ILLAGER, 'vindicator': ILLAGER, 'illusioner': ILLAGER,
|
||||
'sheep': [{'eatTick': t} for t in (2, 10, 36, 39)],
|
||||
'guardian': [{'tailAnimation': 4.0, 'spikesAnimation': 0.3}, {'tailAnimation': 0.0, 'spikesAnimation': 0.0}],
|
||||
'elder_guardian': [{'tailAnimation': 4.0, 'spikesAnimation': 0.3}],
|
||||
|
||||
Reference in New Issue
Block a user