feat(eyes): per-eye sliders, Aswid female defaults from playtest

Each Eyes Position section now has a set per body and per eye (the
character's own left and right), because the face is not symmetric enough for
one set to fit both eyes. The Aswid female defaults are the per-eye values
dialled in on screen; Alfar and Dvergar copy their female values to both eyes.
The old shared keys are dropped: they only ever existed in test builds.
This commit is contained in:
kanym 2026-10-27 16:03:24 +01:00
commit 132d7e034f
5 changed files with 124 additions and 100 deletions

View file

@ -186,24 +186,6 @@ namespace RacesOfValheim
float size = AlfarConfig.EyeSizeMultiplier.Value;
PlayerFace.AdjustEyes(player, ref height, ref separation, ref size);
float forward = AlfarConfig.EyeForward;
float wrap = AlfarConfig.EyeWrap;
float slant = AlfarConfig.EyeSlant;
float tilt = 0f;
EyePositionConfig.Tuning tuning = EyePositionConfig.For(AlfarConfig.RaceId, player);
if (tuning != null)
{
forward += tuning.Forward.Value;
height += tuning.Height.Value;
separation += tuning.Separation.Value;
size *= tuning.Size.Value;
tilt = tuning.RotX;
wrap += tuning.RotY;
slant += tuning.RotZ;
}
Vector3 baseOffset = frame.LocalForward * forward + frame.LocalUp * height;
Vector3 extent = AlfarConfig.EyeExtent * (size * toLocal);
Quaternion facing = Quaternion.LookRotation(frame.LocalForward, frame.LocalUp);
for (int i = 0; i < holder.childCount; i++)
@ -213,11 +195,33 @@ namespace RacesOfValheim
// Index 0 is offset against the right axis, so it is the model's left eye. The
// slant and the wrap are mirrored so both outer corners go up and back.
float side = i == 0 ? -1f : 1f;
Vector3 offset = baseOffset + frame.LocalRight * (side * separation);
// This eye's sliders from "Eyes Position - Alfar".
float forward = AlfarConfig.EyeForward;
float eyeHeight = height;
float eyeSeparation = separation;
float eyeSize = size;
float wrap = AlfarConfig.EyeWrap;
float slant = AlfarConfig.EyeSlant;
float tilt = 0f;
EyePositionConfig.Tuning tuning = EyePositionConfig.For(AlfarConfig.RaceId, player, side);
if (tuning != null)
{
forward += tuning.Forward.Value;
eyeHeight += tuning.Height.Value;
eyeSeparation += tuning.Separation.Value;
eyeSize *= tuning.Size.Value;
tilt = tuning.RotX;
wrap += tuning.RotY;
slant += tuning.RotZ;
}
Vector3 offset = frame.LocalForward * forward + frame.LocalUp * eyeHeight
+ frame.LocalRight * (side * eyeSeparation);
eye.localPosition = offset * toLocal;
eye.localRotation = facing * Quaternion.Euler(tilt, wrap * side, slant * side);
eye.localScale = extent;
eye.localScale = AlfarConfig.EyeExtent * (eyeSize * toLocal);
}
}