#include "orconstraintposition_constraint.h"
#define ORCONSTRAINTPOSITION__CLASS ORCONSTRAINTPOSITION__CLASSNAME
#define ORCONSTRAINTPOSITION__NAME "Position from Position"
#define ORCONSTRAINTPOSITION__LABEL "OR - Position from Position"
#define ORCONSTRAINTPOSITION__DESC "OR - Position from Position Constraint"
ORCONSTRAINTPOSITION__CLASS,
ORCONSTRAINTPOSITION__LABEL,
ORCONSTRAINTPOSITION__DESC,
bool ORConstraintPosition::FBCreate()
{
mGroupSource = ReferenceGroupAdd( "Source Object", 1 );
mGroupConstrain = ReferenceGroupAdd( "Constrain", 1 );
mSourceTranslation =
NULL;
mConstrainedTranslation =
NULL;
mFirstTime = true;
return true;
}
void ORConstraintPosition::FBDestroy()
{
}
void ORConstraintPosition::SetupAllAnimationNodes()
{
if (ReferenceGet( mGroupSource, 0 ) && ReferenceGet( mGroupConstrain, 0 ) )
{
}
}
void ORConstraintPosition::RemoveAllAnimationNodes()
{
}
bool ORConstraintPosition::FbxStore( FBFbxObject* pFbxObject,
kFbxObjectStore pStoreWhat )
{
return true;
}
bool ORConstraintPosition::FbxRetrieve( FBFbxObject* pFbxObject,
kFbxObjectStore pStoreWhat )
{
return true;
}
void ORConstraintPosition::FreezeSuggested()
{
mFirstTime = true;
FBConstraint::FreezeSuggested();
if( ReferenceGet( 0,0 ) )
{
FreezeSRT( (FBModel*)ReferenceGet( 0, 0), true, true, true );
}
}
bool ORConstraintPosition::AnimationNodeNotify(FBAnimationNode* pConnector,FBEvaluateInfo* pEvaluateInfo,FBConstraintInfo* pConstraintInfo)
{
double lPosition[3];
if( mSourceTranslation && mConstrainedTranslation )
{
mSourceTranslation->ReadData ( lPosition, pEvaluateInfo );
mConstrainedTranslation->WriteData ( lPosition, pEvaluateInfo );
}
mPosition = lPosition;
return true;
}