feat(eyes): per-race eye position sliders in Configuration Manager
One 'Eyes Position - <race>' section each for the Alfar, Aswid, Dvergar and Sverm, with a female and a male set: forward, height, separation and size, plus rotation X/Y/Z for the Alfar and Aswid. All are deltas on the computed placement (0 and size 1 change nothing), read live, and left local by ConfigSync because they only change how this client draws faces.
This commit is contained in:
parent
a7e9996441
commit
8b2b5180ed
7 changed files with 155 additions and 11 deletions
|
|
@ -186,7 +186,23 @@ namespace RacesOfValheim
|
|||
float size = AlfarConfig.EyeSizeMultiplier.Value;
|
||||
PlayerFace.AdjustEyes(player, ref height, ref separation, ref size);
|
||||
|
||||
Vector3 baseOffset = frame.LocalForward * AlfarConfig.EyeForward + frame.LocalUp * height;
|
||||
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);
|
||||
|
||||
|
|
@ -200,7 +216,7 @@ namespace RacesOfValheim
|
|||
Vector3 offset = baseOffset + frame.LocalRight * (side * separation);
|
||||
|
||||
eye.localPosition = offset * toLocal;
|
||||
eye.localRotation = facing * Quaternion.Euler(0f, AlfarConfig.EyeWrap * side, AlfarConfig.EyeSlant * side);
|
||||
eye.localRotation = facing * Quaternion.Euler(tilt, wrap * side, slant * side);
|
||||
eye.localScale = extent;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue