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
|
|
@ -39,17 +39,26 @@ namespace RacesOfValheim
|
||||||
public static ConfigEntry<float> WidthScale;
|
public static ConfigEntry<float> WidthScale;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 1 is the Sverm's size, which is what the design asked to try first ("se non va li
|
/// Scales the almond eyes (EyeExtent). The default 0.8 is the tuned grey look; raise it for
|
||||||
/// allarghiamo"). Raise it to enlarge the eyes: 1.6 is roughly a grey from the films.
|
/// bigger eyes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ConfigEntry<float> EyeSizeMultiplier;
|
public static ConfigEntry<float> EyeSizeMultiplier;
|
||||||
|
|
||||||
// The eye geometry is the Sverm's, unchanged (SvermVisuals): offsets are metres in the head
|
// A grey's eyes, on the Sverm's eye spot: offsets are metres in the head bone's OWN frame
|
||||||
// bone's OWN frame, so they land on the same part of the face at any body scale.
|
// at human scale, so they land on the same part of the face at any body scale.
|
||||||
public const float EyeSeparation = 0.032f;
|
// Pushed apart and forward of the Sverm's, because an almond this wide would otherwise
|
||||||
public const float EyeForward = 0.081f;
|
// meet its twin over the nose and sink into the cheek.
|
||||||
public const float EyeHeight = 0.181f;
|
public const float EyeSeparation = 0.037f;
|
||||||
public const float EyeSize = 0.062f;
|
public const float EyeForward = 0.086f;
|
||||||
|
public const float EyeHeight = 0.183f;
|
||||||
|
|
||||||
|
// Full width, height and depth of one eye in metres at Eye Size Multiplier 1. The saved
|
||||||
|
// default of 0.8 makes that 50 x 28 x 18 mm.
|
||||||
|
public static readonly Vector3 EyeExtent = new Vector3(0.0625f, 0.035f, 0.0225f);
|
||||||
|
|
||||||
|
// Degrees. Slant raises the outer corner; wrap turns each eye out toward its temple.
|
||||||
|
public const float EyeSlant = 22f;
|
||||||
|
public const float EyeWrap = 20f;
|
||||||
|
|
||||||
// ─── Eitr: diet, shield, soft fall ───────────────────────────────────
|
// ─── Eitr: diet, shield, soft fall ───────────────────────────────────
|
||||||
|
|
||||||
|
|
@ -152,7 +161,7 @@ namespace RacesOfValheim
|
||||||
new AcceptableValueRange<float>(0.7f, 1.2f)));
|
new AcceptableValueRange<float>(0.7f, 1.2f)));
|
||||||
|
|
||||||
EyeSizeMultiplier = config.Bind(look, "Eye Size Multiplier", 0.8f,
|
EyeSizeMultiplier = config.Bind(look, "Eye Size Multiplier", 0.8f,
|
||||||
new ConfigDescription("1 = the Sverm's eye size; 0.8 is slightly smaller. Raise to enlarge the black eyes.",
|
new ConfigDescription("Scales the black almond eyes. 0.8 is the default look; raise it for bigger eyes.",
|
||||||
new AcceptableValueRange<float>(0.5f, 3f)));
|
new AcceptableValueRange<float>(0.5f, 3f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,35 +161,47 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
if (eyes == null) return;
|
if (eyes == null) return;
|
||||||
|
|
||||||
PlaceEyes(headBone, eyes);
|
PlaceEyes(player, eyes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PlaceEyes(Transform headBone, Transform holder)
|
/// <summary>
|
||||||
|
/// A grey's eyes: wide black almonds, outer corners raised, wrapping round the sides of the
|
||||||
|
/// face. Each is a sphere squashed to an ellipsoid and turned in the skull's own frame.
|
||||||
|
///
|
||||||
|
/// FIXED HEAD-LOCAL UNITS, never headBone.lossyScale. The Alfar Visual is scaled
|
||||||
|
/// non-uniformly, so the head's lossyScale is only an approximation that changes as the
|
||||||
|
/// head turns; recomputed on the 0.5s cosmetic pass it made the eyes trail the face. The
|
||||||
|
/// face is skinned to the same bone through the same matrices, so a constant local offset
|
||||||
|
/// stays glued to it at any body scale, and PlaceEyes only has to run when the eyes change.
|
||||||
|
/// </summary>
|
||||||
|
private static void PlaceEyes(Player player, Transform holder)
|
||||||
{
|
{
|
||||||
Vector3 lossy = headBone.lossyScale;
|
|
||||||
if (Mathf.Abs(lossy.x) < 0.0001f || Mathf.Abs(lossy.y) < 0.0001f || Mathf.Abs(lossy.z) < 0.0001f) return;
|
|
||||||
|
|
||||||
EyeFrame frame = holder.GetComponent<EyeFrame>();
|
EyeFrame frame = holder.GetComponent<EyeFrame>();
|
||||||
if (frame == null) return;
|
if (frame == null) return;
|
||||||
|
|
||||||
// The Visual is scaled non-uniformly (thinner than tall), so lossyScale has three
|
const float toLocal = PlayerFace.MetresToHeadLocal;
|
||||||
// different components and a single divisor would squash the spheres. Each axis is
|
|
||||||
// divided by its own.
|
|
||||||
Vector3 toLocal = new Vector3(1f / lossy.x, 1f / lossy.y, 1f / lossy.z);
|
|
||||||
float eyeSize = AlfarConfig.EyeSize * AlfarConfig.EyeSizeMultiplier.Value;
|
|
||||||
|
|
||||||
Vector3 baseOffset = frame.LocalForward * AlfarConfig.EyeForward + frame.LocalUp * AlfarConfig.EyeHeight;
|
float height = AlfarConfig.EyeHeight;
|
||||||
|
float separation = AlfarConfig.EyeSeparation;
|
||||||
|
float size = AlfarConfig.EyeSizeMultiplier.Value;
|
||||||
|
PlayerFace.AdjustEyes(player, ref height, ref separation, ref size);
|
||||||
|
|
||||||
|
Vector3 baseOffset = frame.LocalForward * AlfarConfig.EyeForward + 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++)
|
for (int i = 0; i < holder.childCount; i++)
|
||||||
{
|
{
|
||||||
Transform eye = holder.GetChild(i);
|
Transform eye = holder.GetChild(i);
|
||||||
|
|
||||||
// Index 0 is offset against the right axis, so it is the model's left eye.
|
// 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;
|
float side = i == 0 ? -1f : 1f;
|
||||||
Vector3 offset = baseOffset + frame.LocalRight * (side * AlfarConfig.EyeSeparation);
|
Vector3 offset = baseOffset + frame.LocalRight * (side * separation);
|
||||||
|
|
||||||
eye.localPosition = Vector3.Scale(offset, toLocal);
|
eye.localPosition = offset * toLocal;
|
||||||
eye.localScale = Vector3.Scale(Vector3.one * eyeSize, toLocal);
|
eye.localRotation = facing * Quaternion.Euler(0f, AlfarConfig.EyeWrap * side, AlfarConfig.EyeSlant * side);
|
||||||
|
eye.localScale = extent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -234,9 +246,8 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Matte black, and nothing else: the colour is black, the emission is black, and the two
|
/// Black with a wet sheen: no emission, but smooth enough to catch a highlight, which is
|
||||||
/// properties that make a lit shader shine are zeroed where the shader has them. The
|
/// what makes a grey's eyes read as eyes and not as two holes punched in the face.
|
||||||
/// Sverm's eyes burn; these must read as holes.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static Material BlackMaterial(Shader shader)
|
private static Material BlackMaterial(Shader shader)
|
||||||
{
|
{
|
||||||
|
|
@ -244,10 +255,9 @@ namespace RacesOfValheim
|
||||||
material.color = Color.black;
|
material.color = Color.black;
|
||||||
|
|
||||||
if (material.HasProperty("_EmissionColor")) material.SetColor("_EmissionColor", Color.black);
|
if (material.HasProperty("_EmissionColor")) material.SetColor("_EmissionColor", Color.black);
|
||||||
if (material.HasProperty("_Glossiness")) material.SetFloat("_Glossiness", 0f);
|
if (material.HasProperty("_Glossiness")) material.SetFloat("_Glossiness", 0.8f);
|
||||||
if (material.HasProperty("_Smoothness")) material.SetFloat("_Smoothness", 0f);
|
if (material.HasProperty("_Smoothness")) material.SetFloat("_Smoothness", 0.8f);
|
||||||
if (material.HasProperty("_Metallic")) material.SetFloat("_Metallic", 0f);
|
if (material.HasProperty("_Metallic")) material.SetFloat("_Metallic", 0f);
|
||||||
if (material.HasProperty("_SpecColor")) material.SetColor("_SpecColor", Color.black);
|
|
||||||
|
|
||||||
return material;
|
return material;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 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 }));
|
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.",
|
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 }));
|
null, new ConfigurationManagerAttributes { Order = 50 }));
|
||||||
EyeFlatColorShader = config.Bind(eyes, "Eye Flat Colour Shader", false,
|
EyeFlatColorShader = config.Bind(eyes, "Eye Flat Colour Shader", false,
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,11 @@ namespace RacesOfValheim
|
||||||
private const float BaseEyeHeight = 0.181f;
|
private const float BaseEyeHeight = 0.181f;
|
||||||
private const float BaseEyeSeparation = 0.032f;
|
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 ─────────────────────────────────────────────────────
|
// ─── Race check ─────────────────────────────────────────────────────
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -99,6 +104,10 @@ namespace RacesOfValheim
|
||||||
// built again rather than merely moved.
|
// built again rather than merely moved.
|
||||||
public string SourceModel = "";
|
public string SourceModel = "";
|
||||||
public bool FlatShader;
|
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>
|
/// <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>();
|
EyeFrame existing = eyes.GetComponent<EyeFrame>();
|
||||||
if (existing == null ||
|
if (existing == null ||
|
||||||
existing.SourceModel != AswidConfig.EyeSourceModel.Value ||
|
existing.SourceModel != AswidConfig.EyeSourceModel.Value ||
|
||||||
existing.FlatShader != AswidConfig.EyeFlatColorShader.Value)
|
existing.FlatShader != AswidConfig.EyeFlatColorShader.Value ||
|
||||||
|
existing.Female != PlayerFace.IsFemale(player))
|
||||||
{
|
{
|
||||||
eyes.name = EyesName + "_Removed";
|
eyes.name = EyesName + "_Removed";
|
||||||
Object.Destroy(eyes.gameObject);
|
Object.Destroy(eyes.gameObject);
|
||||||
|
|
@ -424,6 +434,12 @@ namespace RacesOfValheim
|
||||||
MeasureFrame(player, headBone, frame);
|
MeasureFrame(player, headBone, frame);
|
||||||
frame.SourceModel = modelName;
|
frame.SourceModel = modelName;
|
||||||
frame.FlatShader = AswidConfig.EyeFlatColorShader.Value;
|
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
|
// 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
|
// 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;
|
float toLocal = 1f / headBone.lossyScale.x;
|
||||||
|
|
||||||
Vector3 basePosition = frame.LocalForward * (BaseEyeForward * toLocal)
|
Vector3 basePosition = frame.LocalForward * (BaseEyeForward * toLocal)
|
||||||
+ frame.LocalUp * (BaseEyeHeight * toLocal)
|
+ frame.LocalUp * (baseHeight * toLocal)
|
||||||
+ frame.LocalRight * (side * BaseEyeSeparation * toLocal);
|
+ frame.LocalRight * (side * baseSeparation * toLocal);
|
||||||
|
|
||||||
// The socket's own authored tilt is skipped for the same reason its position is -
|
// 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
|
// 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
|
// 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
|
// lands at exactly the size vanilla wears them, which is the whole point of
|
||||||
// borrowing them instead of drawing spheres.
|
// 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
|
// Remembered before anything moves it, because everything the config does is
|
||||||
// expressed as a delta on this.
|
// expressed as a delta on this.
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,9 @@ namespace RacesOfValheim
|
||||||
public static readonly float EyeSeparation = 0.032f; // half the distance between them
|
public static readonly float EyeSeparation = 0.032f; // half the distance between them
|
||||||
public static readonly float EyeForward = 0.081f; // centre ~63mm out
|
public static readonly float EyeForward = 0.081f; // centre ~63mm out
|
||||||
public static readonly float EyeHeight = 0.181f; // ~15mm lower than before
|
public static readonly float EyeHeight = 0.181f; // ~15mm lower than before
|
||||||
public static readonly float EyeSize = 0.062f; // ~48mm across, so a 24mm radius
|
// Then cut down after playtest: at 0.062 the cap read as two lamps covering the face. An
|
||||||
|
// 18mm radius at the same depth leaves a cap of about 22mm on a 0.78 Dvergar.
|
||||||
|
public static readonly float EyeSize = 0.036f;
|
||||||
|
|
||||||
// How hard the eyes burn. The colours the game gives a starred dverger are HDR - one star
|
// How hard the eyes burn. The colours the game gives a starred dverger are HDR - one star
|
||||||
// is (0, 4, 3.3) - and anything past 1 clips to white on the way to the bloom pass, which
|
// is (0, 4, 3.3) - and anything past 1 clips to white on the way to the bloom pass, which
|
||||||
|
|
|
||||||
|
|
@ -277,10 +277,16 @@ namespace RacesOfValheim
|
||||||
// metre was the entire drift: the offsets below are under a centimetre in local units
|
// metre was the entire drift: the offsets below are under a centimetre in local units
|
||||||
// and never stood a chance of mattering next to it.
|
// and never stood a chance of mattering next to it.
|
||||||
float raceScale = GetVisualScale(player);
|
float raceScale = GetVisualScale(player);
|
||||||
Vector3 baseLocal = localForward * (DvergarConfig.EyeForward * raceScale * toLocal)
|
|
||||||
+ localUp * (DvergarConfig.EyeHeight * raceScale * toLocal);
|
|
||||||
|
|
||||||
float eyeLocalSize = DvergarConfig.EyeSize * raceScale * toLocal;
|
float height = DvergarConfig.EyeHeight;
|
||||||
|
float separation = DvergarConfig.EyeSeparation;
|
||||||
|
float eyeSize = DvergarConfig.EyeSize;
|
||||||
|
PlayerFace.AdjustEyes(player, ref height, ref separation, ref eyeSize);
|
||||||
|
|
||||||
|
Vector3 baseLocal = localForward * (DvergarConfig.EyeForward * raceScale * toLocal)
|
||||||
|
+ localUp * (height * raceScale * toLocal);
|
||||||
|
|
||||||
|
float eyeLocalSize = eyeSize * raceScale * toLocal;
|
||||||
|
|
||||||
for (int i = 0; i < holder.childCount; i++)
|
for (int i = 0; i < holder.childCount; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -293,7 +299,7 @@ namespace RacesOfValheim
|
||||||
float side = i == 0 ? -1f : 1f;
|
float side = i == 0 ? -1f : 1f;
|
||||||
float size = i == 0 ? eyeLocalSize * DvergarConfig.LeftEyeSizeMultiplier : eyeLocalSize;
|
float size = i == 0 ? eyeLocalSize * DvergarConfig.LeftEyeSizeMultiplier : eyeLocalSize;
|
||||||
|
|
||||||
eye.localPosition = baseLocal + localRight * (side * DvergarConfig.EyeSeparation * raceScale * toLocal);
|
eye.localPosition = baseLocal + localRight * (side * separation * raceScale * toLocal);
|
||||||
eye.localScale = Vector3.one * size;
|
eye.localScale = Vector3.one * size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
49
JotunnModStub/PlayerFace.cs
Normal file
49
JotunnModStub/PlayerFace.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace RacesOfValheim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Where a player's painted eyes are, for the races that hang something over them (Alfar,
|
||||||
|
/// Aswid, Dvergar, Sverm).
|
||||||
|
///
|
||||||
|
/// Every eye constant in this mod (0.081 forward, 0.181 up, 0.032 apart) was tuned on the MALE
|
||||||
|
/// body. The female body is a different mesh on the same rig and the same skin texture, and it
|
||||||
|
/// maps the painted eyes elsewhere: read offline from VisEquipment.m_models (bodymale vs
|
||||||
|
/// bodyfem, Valheim 1.0.20), by finding the dark socket pixels of PlayerCharacter_01 and
|
||||||
|
/// following the UVs back onto each mesh in head-bone space, the female eyes sit about 6mm
|
||||||
|
/// lower and a quarter closer together. Both are weighted 100% to Head, so once placed they
|
||||||
|
/// follow the head exactly; a sphere on the male spot simply sits on the brow, off the face.
|
||||||
|
///
|
||||||
|
/// HEAD-LOCAL UNITS. The player armature is authored at 100x, so one metre at human scale is
|
||||||
|
/// 0.01 in the head bone's own space. That is a constant of the rig, not of this frame:
|
||||||
|
/// reading headBone.lossyScale live instead breaks under a non-uniform body scale (the Alfar),
|
||||||
|
/// where the value drifts as the head turns.
|
||||||
|
/// </summary>
|
||||||
|
public static class PlayerFace
|
||||||
|
{
|
||||||
|
public const float MetresToHeadLocal = 0.01f;
|
||||||
|
|
||||||
|
// Female against male, measured as described above.
|
||||||
|
private const float FemaleHeightShift = -0.006f;
|
||||||
|
private const float FemaleSeparationScale = 0.75f;
|
||||||
|
private const float FemaleSizeScale = 0.9f;
|
||||||
|
|
||||||
|
/// <summary>True while the body wears the female mesh (VisEquipment model index 1).</summary>
|
||||||
|
public static bool IsFemale(Player player)
|
||||||
|
{
|
||||||
|
VisEquipment vis = player != null ? player.GetComponent<VisEquipment>() : null;
|
||||||
|
if (vis == null || vis.m_bodyModel == null || vis.m_models == null || vis.m_models.Length < 2) return false;
|
||||||
|
return vis.m_bodyModel.sharedMesh == vis.m_models[1].m_mesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Moves male-tuned eye numbers (metres) onto the female face; leaves a male face alone.</summary>
|
||||||
|
public static void AdjustEyes(Player player, ref float height, ref float separation, ref float size)
|
||||||
|
{
|
||||||
|
if (!IsFemale(player)) return;
|
||||||
|
|
||||||
|
height += FemaleHeightShift;
|
||||||
|
separation *= FemaleSeparationScale;
|
||||||
|
size *= FemaleSizeScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -251,10 +251,15 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
float scale = player.transform.localScale.x;
|
float scale = player.transform.localScale.x;
|
||||||
|
|
||||||
Vector3 baseLocal = frame.LocalForward * (EyeForward * scale * toLocal)
|
float height = EyeHeight;
|
||||||
+ frame.LocalUp * (EyeHeight * scale * toLocal);
|
float separation = EyeSeparation;
|
||||||
|
float eyeSize = EyeSize;
|
||||||
|
PlayerFace.AdjustEyes(player, ref height, ref separation, ref eyeSize);
|
||||||
|
|
||||||
float eyeLocalSize = EyeSize * scale * toLocal;
|
Vector3 baseLocal = frame.LocalForward * (EyeForward * scale * toLocal)
|
||||||
|
+ frame.LocalUp * (height * scale * toLocal);
|
||||||
|
|
||||||
|
float eyeLocalSize = eyeSize * scale * toLocal;
|
||||||
|
|
||||||
for (int i = 0; i < holder.childCount; i++)
|
for (int i = 0; i < holder.childCount; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -264,7 +269,7 @@ namespace RacesOfValheim
|
||||||
float side = i == 0 ? -1f : 1f;
|
float side = i == 0 ? -1f : 1f;
|
||||||
float size = i == 0 ? eyeLocalSize * LeftEyeSizeMultiplier : eyeLocalSize;
|
float size = i == 0 ? eyeLocalSize * LeftEyeSizeMultiplier : eyeLocalSize;
|
||||||
|
|
||||||
eye.localPosition = baseLocal + frame.LocalRight * (side * EyeSeparation * scale * toLocal);
|
eye.localPosition = baseLocal + frame.LocalRight * (side * separation * scale * toLocal);
|
||||||
eye.localScale = Vector3.one * size;
|
eye.localScale = Vector3.one * size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue