mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-03 19:33:43 +00:00
fix(nif): leave out a root node's rotation and translation
The client's render component sets the object's own position and rotation on the root node it loads, over the stored ones, so a root's turn never shows in game (its scale stays). NifFile now reads roots the same way. LU Toolbox's .nif (root turned 90 degrees about X, the NiLODNodes turned back) now stands up in icons and the dashboard's views; every game .nif has an unturned root and reads as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -387,7 +387,14 @@ namespace {
|
||||
reader.Skip(static_cast<uint64_t>(effectCount) * 4);
|
||||
if (!reader.Ok()) return;
|
||||
|
||||
const auto world = parent.Then(av.transform);
|
||||
// The client puts the object's own position and rotation in place of the root node's (the render component
|
||||
// sets them on the loaded root), so a root's stored rotation and translation are never seen; its scale is kept
|
||||
auto local = av.transform;
|
||||
if (depth == 0) {
|
||||
local.r = Transform{}.r;
|
||||
local.t = {};
|
||||
}
|
||||
const auto world = parent.Then(local);
|
||||
// Recorded even when hidden: attach points often are
|
||||
if (!av.name.empty() && !m_Model.nodes.contains(av.name)) {
|
||||
NifFile::NodeTransform node;
|
||||
|
||||
Reference in New Issue
Block a user