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:
parent
ffba40650e
commit
132d7e034f
5 changed files with 124 additions and 100 deletions
|
|
@ -256,30 +256,31 @@ namespace RacesOfValheim
|
|||
float eyeSize = EyeSize;
|
||||
PlayerFace.AdjustEyes(player, ref height, ref separation, ref eyeSize);
|
||||
|
||||
float forward = EyeForward;
|
||||
EyePositionConfig.Tuning tuning = EyePositionConfig.For(SvermConfig.RaceId, player);
|
||||
if (tuning != null)
|
||||
{
|
||||
forward += tuning.Forward.Value;
|
||||
height += tuning.Height.Value;
|
||||
separation += tuning.Separation.Value;
|
||||
eyeSize *= tuning.Size.Value;
|
||||
}
|
||||
|
||||
Vector3 baseLocal = frame.LocalForward * (forward * scale * toLocal)
|
||||
+ frame.LocalUp * (height * scale * toLocal);
|
||||
|
||||
float eyeLocalSize = eyeSize * scale * toLocal;
|
||||
|
||||
for (int i = 0; i < holder.childCount; i++)
|
||||
{
|
||||
Transform eye = holder.GetChild(i);
|
||||
|
||||
// Index 0 is offset against the right axis, so it is the model's left eye.
|
||||
float side = i == 0 ? -1f : 1f;
|
||||
float size = i == 0 ? eyeLocalSize * LeftEyeSizeMultiplier : eyeLocalSize;
|
||||
|
||||
eye.localPosition = baseLocal + frame.LocalRight * (side * separation * scale * toLocal);
|
||||
// This eye's sliders from "Eyes Position - Sverm".
|
||||
float forward = EyeForward;
|
||||
float eyeHeight = height;
|
||||
float eyeSeparation = separation;
|
||||
float size = eyeSize * scale * toLocal;
|
||||
EyePositionConfig.Tuning tuning = EyePositionConfig.For(SvermConfig.RaceId, player, side);
|
||||
if (tuning != null)
|
||||
{
|
||||
forward += tuning.Forward.Value;
|
||||
eyeHeight += tuning.Height.Value;
|
||||
eyeSeparation += tuning.Separation.Value;
|
||||
size *= tuning.Size.Value;
|
||||
}
|
||||
if (i == 0) size *= LeftEyeSizeMultiplier;
|
||||
|
||||
eye.localPosition = frame.LocalForward * (forward * scale * toLocal)
|
||||
+ frame.LocalUp * (eyeHeight * scale * toLocal)
|
||||
+ frame.LocalRight * (side * eyeSeparation * scale * toLocal);
|
||||
eye.localScale = Vector3.one * size;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue