fix(dvergar): put the eyes on the head instead of on the camera
Both faults reported came from the same wrong anchor. Character.m_eye is the camera's eye point, not the model's: it lives outside the scaled rig, so on a Dvergar - who renders at 78% - the quads hung where a full-height human's face would have been, a foot above the head. And it turns with the look direction rather than with the face, so they pointed wherever the player was looking rather than wherever the head was. They now hang off the player root, unscaled, and are placed onto the head bone in world space every frame: position from the bone, orientation from the player's own facing, and every offset multiplied by the race's visual scale so they shrink with the body. That also means the placement constants are honest metres measured from the base of the skull, which is what makes them tunable at all. Driven per frame from the two places that already tick a Dvergar - the race script for the local player, the visual controller for remote ones - because world-space placement has to be re-applied rather than inherited.
This commit is contained in:
parent
9dc072f0a5
commit
76b89a8e5a
4 changed files with 56 additions and 20 deletions
|
|
@ -69,6 +69,10 @@ namespace RacesOfValheim
|
|||
|
||||
DvergarVisuals.ApplyHood(player);
|
||||
|
||||
// Every frame, because the eyes are placed onto the head bone in world space rather
|
||||
// than parented to it - see ApplyEyes for why.
|
||||
DvergarVisuals.ApplyEyes(player);
|
||||
|
||||
// Max health is recomputed by Player.UpdateFood, which runs on its own schedule. Left
|
||||
// to itself the malus would only take effect at the next food tick, so a change of
|
||||
// race or of tier is pushed through immediately - this is also what makes the health
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue