diff --git a/nif_objects.h b/nif_objects.h index 6f26ee1d62b4e3db7d13b883045de1772fea8ade..b29ecd6f0064de5743a8771afea99c46a3ecaf5f 100644 --- a/nif_objects.h +++ b/nif_objects.h @@ -242,7 +242,7 @@ template <class T> const Ref<T> DynamicCast( const NiObject * object ) { const Type NiObject::TYPE("NiObject", NULL ); /* - * NiObjectNET - An object that has a name and can be parented to other objects. Can have extra data and controllers attatched. + * NiObjectNET - An object that has a name. Can have extra data and controllers attatched. */ class NiObjectNET; @@ -257,14 +257,7 @@ public: static const Type TYPE; string name; - - void SetParent( NiObjectNETRef new_parent ) { - parent = new_parent; - } - NiObjectNETRef GetParent() { return parent; } - private: - NiObjectNET * parent; //TODO: pointer to extra data type... find out what that is. AExtraData right now. Need functions to add/remove. //TODO: pointer to first NiTimeController type. Need functions to add/remove. }; @@ -328,7 +321,13 @@ public: */ void SetWorldBindPos( Matrix44 const & m ); + void SetParent( NiAVObjectRef new_parent ) { + parent = new_parent; + } + NiAVObjectRef GetParent() { return parent; } + protected: + NiAVObject * parent; void ResetSkinnedFlag(); Matrix44 bindPosition; diff --git a/niflib.cpp b/niflib.cpp index fc872ece89d95e9d5ec6d7af64b6b4ea39ded94d..6c17a34eb7d88d80782cf01928d832b52537ae68 100644 --- a/niflib.cpp +++ b/niflib.cpp @@ -101,9 +101,9 @@ NiObjectRef FindRoot( vector<NiObjectRef> const & blocks ) { //--Look for a NiNode that has no parents--// //Find the first NiObjectNET derived object - NiObjectNETRef root; + NiAVObjectRef root; for (uint i = 0; i < blocks.size(); ++i) { - root = DynamicCast<NiObjectNET>(blocks[i]); + root = DynamicCast<NiAVObject>(blocks[i]); if ( root != NULL ) { break; }