Skip to content
Snippets Groups Projects
Commit 06eab46c authored by Tazpn's avatar Tazpn
Browse files

Add extra targets getter/setter for multitargeter controller. Probably need...

Add extra targets getter/setter for multitargeter controller.  Probably need to fix GetRefs() at some point get return weak pointer references as well as strong ones.
parent ff78d497
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ All rights reserved. Please see niflib.h for licence. */
#include "NiMultiTargetTransformController.h"
#include "NiNode.h"
#include <algorithm>
using namespace Niflib;
//Definition of TYPE constant
......@@ -36,3 +37,21 @@ const Type & NiMultiTargetTransformController::GetType() const {
return TYPE;
};
vector<NiNodeRef> NiMultiTargetTransformController::GetExtraTargets() const {
vector<NiNodeRef> retval;
size_t n = extraTargets.size();
retval.reserve(n);
for (size_t i=0; i<n; ++i)
retval.push_back( NiNodeRef(extraTargets[i]) );
return retval;
}
void NiMultiTargetTransformController::SetExtraTargets( const vector<NiNodeRef>& value ) {
extraTargets.clear();
size_t n = value.size();
extraTargets.reserve(n);
for (size_t i=0; i<n; ++i)
extraTargets.push_back( value[i].Ptr() );
extraTargets.erase(std::remove(extraTargets.begin(), extraTargets.end(), (NiNode*)NULL), extraTargets.end());
}
......@@ -5,6 +5,7 @@ All rights reserved. Please see niflib.h for licence. */
#define _NIMULTITARGETTRANSFORMCONTROLLER_H_
#include "NiTimeController.h"
namespace Niflib {
// Forward define of referenced blocks
......@@ -35,6 +36,12 @@ public:
virtual list<NiObjectRef> GetRefs() const;
virtual const Type & GetType() const;
/*!
* NiNode Targets to be controlled.
*/
vector<Ref<NiNode> > GetExtraTargets() const;
void SetExtraTargets( const vector< Ref<NiNode> >& value );
protected:
NI_MULTI_TARGET_TRANSFORM_CONTROLLER_MEMBERS
STANDARD_INTERNAL_METHODS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment