fix(eyes): female face placement, smaller Dvergar/Aswid eyes, grey Alfar eyes
The female body maps the painted eyes about 6 mm lower and a quarter closer together than the male one (read from bodymale/bodyfem and the skin UVs), so every race's male-tuned eyes sat on the female brow. PlayerFace moves them for the Dvergar, Aswid, Sverm and Alfar. Dvergar eyes shrink to an 18 mm radius. The Aswid's borrowed sockets are halved before the config multiplier and the smoke is off by default. Alfar eyes become slanted, wrapped black almonds with a wet sheen. They are placed in fixed head-local units: the live lossyScale under the non-uniform Alfar body drifted as the head turned, and the 0.5 s cosmetic pass made the eyes trail the face.
This commit is contained in:
parent
a927a6d4b3
commit
026def2fde
8 changed files with 139 additions and 42 deletions
|
|
@ -453,7 +453,7 @@ namespace RacesOfValheim
|
|||
new ConfigDescription("As above, around the third axis. The default half turn is what rights the borrowed socket, which arrives upside down on a player's head bone.",
|
||||
new AcceptableValueRange<float>(-180f, 180f), new ConfigurationManagerAttributes { Order = 58 }));
|
||||
|
||||
EyeSmoke = config.Bind(eyes, "Eye Smoke", true,
|
||||
EyeSmoke = config.Bind(eyes, "Eye Smoke", false,
|
||||
new ConfigDescription("Lights the smoke the creature carries inside its own sockets and leaves switched off. Tinted to match the eyes, so it turns with them at the last stage.",
|
||||
null, new ConfigurationManagerAttributes { Order = 50 }));
|
||||
EyeFlatColorShader = config.Bind(eyes, "Eye Flat Colour Shader", false,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ namespace RacesOfValheim
|
|||
private const float BaseEyeHeight = 0.181f;
|
||||
private const float BaseEyeSeparation = 0.032f;
|
||||
|
||||
// The borrowed socket at the size the Skeleton wears it, times the config multiplier, was
|
||||
// two green blocks on the face. This halves it before the multiplier, so a saved config
|
||||
// keeps its meaning as "relative to the default" and the eyes read as two small points.
|
||||
private const float BaseEyeScale = 0.5f;
|
||||
|
||||
// ─── Race check ─────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -99,6 +104,10 @@ namespace RacesOfValheim
|
|||
// built again rather than merely moved.
|
||||
public string SourceModel = "";
|
||||
public bool FlatShader;
|
||||
|
||||
// Which body the base pose was measured for: the female face puts the eyes elsewhere
|
||||
// (PlayerFace), so a change of body model is a rebuild too.
|
||||
public bool Female;
|
||||
}
|
||||
|
||||
/// <summary>The pose an eye was authored at on the creature. Everything else is a delta on this.</summary>
|
||||
|
|
@ -180,7 +189,8 @@ namespace RacesOfValheim
|
|||
EyeFrame existing = eyes.GetComponent<EyeFrame>();
|
||||
if (existing == null ||
|
||||
existing.SourceModel != AswidConfig.EyeSourceModel.Value ||
|
||||
existing.FlatShader != AswidConfig.EyeFlatColorShader.Value)
|
||||
existing.FlatShader != AswidConfig.EyeFlatColorShader.Value ||
|
||||
existing.Female != PlayerFace.IsFemale(player))
|
||||
{
|
||||
eyes.name = EyesName + "_Removed";
|
||||
Object.Destroy(eyes.gameObject);
|
||||
|
|
@ -424,6 +434,12 @@ namespace RacesOfValheim
|
|||
MeasureFrame(player, headBone, frame);
|
||||
frame.SourceModel = modelName;
|
||||
frame.FlatShader = AswidConfig.EyeFlatColorShader.Value;
|
||||
frame.Female = PlayerFace.IsFemale(player);
|
||||
|
||||
float baseHeight = BaseEyeHeight;
|
||||
float baseSeparation = BaseEyeSeparation;
|
||||
float baseSize = BaseEyeScale;
|
||||
PlayerFace.AdjustEyes(player, ref baseHeight, ref baseSeparation, ref baseSize);
|
||||
|
||||
// canonicalToFrame turns "face forward, as authored" into "face forward, on THIS
|
||||
// rig's own axes" - the rotation that carries the ordinary (X,Y,Z) convention onto
|
||||
|
|
@ -458,8 +474,8 @@ namespace RacesOfValheim
|
|||
float toLocal = 1f / headBone.lossyScale.x;
|
||||
|
||||
Vector3 basePosition = frame.LocalForward * (BaseEyeForward * toLocal)
|
||||
+ frame.LocalUp * (BaseEyeHeight * toLocal)
|
||||
+ frame.LocalRight * (side * BaseEyeSeparation * toLocal);
|
||||
+ frame.LocalUp * (baseHeight * toLocal)
|
||||
+ frame.LocalRight * (side * baseSeparation * toLocal);
|
||||
|
||||
// The socket's own authored tilt is skipped for the same reason its position is -
|
||||
// canonicalToFrame alone (face forward, on this rig's axes) is what the config's
|
||||
|
|
@ -481,7 +497,7 @@ namespace RacesOfValheim
|
|||
// this object at on a real skeleton. Divided into the new parent's scale, the pair
|
||||
// lands at exactly the size vanilla wears them, which is the whole point of
|
||||
// borrowing them instead of drawing spheres.
|
||||
Vector3 baseScale = source.lossyScale * toLocal;
|
||||
Vector3 baseScale = source.lossyScale * (toLocal * baseSize);
|
||||
|
||||
// Remembered before anything moves it, because everything the config does is
|
||||
// expressed as a delta on this.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue