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
|
|
@ -283,21 +283,6 @@ namespace RacesOfValheim
|
|||
float eyeSize = DvergarConfig.EyeSize;
|
||||
PlayerFace.AdjustEyes(player, ref height, ref separation, ref eyeSize);
|
||||
|
||||
float forward = DvergarConfig.EyeForward;
|
||||
EyePositionConfig.Tuning tuning = EyePositionConfig.For(DvergarConfig.RaceId, player);
|
||||
if (tuning != null)
|
||||
{
|
||||
forward += tuning.Forward.Value;
|
||||
height += tuning.Height.Value;
|
||||
separation += tuning.Separation.Value;
|
||||
eyeSize *= tuning.Size.Value;
|
||||
}
|
||||
|
||||
Vector3 baseLocal = localForward * (forward * raceScale * toLocal)
|
||||
+ localUp * (height * raceScale * toLocal);
|
||||
|
||||
float eyeLocalSize = eyeSize * raceScale * toLocal;
|
||||
|
||||
for (int i = 0; i < holder.childCount; i++)
|
||||
{
|
||||
Transform eye = holder.GetChild(i);
|
||||
|
|
@ -307,9 +292,25 @@ namespace RacesOfValheim
|
|||
// curved and the two sides do not present the same surface to a ball of this
|
||||
// radius.
|
||||
float side = i == 0 ? -1f : 1f;
|
||||
float size = i == 0 ? eyeLocalSize * DvergarConfig.LeftEyeSizeMultiplier : eyeLocalSize;
|
||||
|
||||
eye.localPosition = baseLocal + localRight * (side * separation * raceScale * toLocal);
|
||||
// This eye's sliders from "Eyes Position - Dvergar".
|
||||
float forward = DvergarConfig.EyeForward;
|
||||
float eyeHeight = height;
|
||||
float eyeSeparation = separation;
|
||||
float size = eyeSize * raceScale * toLocal;
|
||||
EyePositionConfig.Tuning tuning = EyePositionConfig.For(DvergarConfig.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 *= DvergarConfig.LeftEyeSizeMultiplier;
|
||||
|
||||
eye.localPosition = localForward * (forward * raceScale * toLocal)
|
||||
+ localUp * (eyeHeight * raceScale * toLocal)
|
||||
+ localRight * (side * eyeSeparation * raceScale * toLocal);
|
||||
eye.localScale = Vector3.one * size;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue