mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Store the parents of NIF's nodes
This commit is contained in:
parent
046e9686f9
commit
291599c609
@ -31,6 +31,8 @@
|
||||
namespace Nif
|
||||
{
|
||||
|
||||
class NiNode;
|
||||
|
||||
/** A Node is an object that's part of the main NIF tree. It has
|
||||
parent node (unless it's the root), and transformation (location
|
||||
and rotation) relative to it's parent.
|
||||
@ -66,6 +68,8 @@ public:
|
||||
boundXYZ = nif->getVector();
|
||||
}
|
||||
|
||||
parent = NULL;
|
||||
|
||||
boneTrafo = NULL;
|
||||
boneIndex = -1;
|
||||
}
|
||||
@ -76,6 +80,10 @@ public:
|
||||
props.post(nif);
|
||||
}
|
||||
|
||||
// Parent node, or NULL for the root node. As far as I'm aware, only
|
||||
// NiNodes (or types derived from NiNodes) can be parents.
|
||||
NiNode *parent;
|
||||
|
||||
// Bone transformation. If set, node is a part of a skeleton.
|
||||
const NiSkinData::BoneTrafo *boneTrafo;
|
||||
|
||||
@ -139,6 +147,9 @@ struct NiNode : Node
|
||||
Node::post(nif);
|
||||
children.post(nif);
|
||||
effects.post(nif);
|
||||
|
||||
for(size_t i = 0;i < children.length();i++)
|
||||
children[i].parent = this;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user