constraints/constraint3Dcurvedeformer/orconstraint3Dcurvedeformer_constraint.h

constraints/constraint3Dcurvedeformer/orconstraint3Dcurvedeformer_constraint.h
/***************************************************************************************
Autodesk(R) Open Reality(R) Samples
(C) 2009 Autodesk, Inc. and/or its licensors
All rights reserved.
AUTODESK SOFTWARE LICENSE AGREEMENT
Autodesk, Inc. licenses this Software to you only upon the condition that
you accept all of the terms contained in the Software License Agreement ("Agreement")
that is embedded in or that is delivered with this Software. By selecting
the "I ACCEPT" button at the end of the Agreement or by copying, installing,
uploading, accessing or using all or any portion of the Software you agree
to enter into the Agreement. A contract is then formed between Autodesk and
either you personally, if you acquire the Software for yourself, or the company
or other legal entity for which you are acquiring the software.
AUTODESK, INC., MAKES NO WARRANTY, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE REGARDING THESE MATERIALS, AND MAKES SUCH MATERIALS AVAILABLE SOLELY ON AN
"AS-IS" BASIS.
IN NO EVENT SHALL AUTODESK, INC., BE LIABLE TO ANYONE FOR SPECIAL, COLLATERAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING OUT OF PURCHASE
OR USE OF THESE MATERIALS. THE SOLE AND EXCLUSIVE LIABILITY TO AUTODESK, INC.,
REGARDLESS OF THE FORM OF ACTION, SHALL NOT EXCEED THE PURCHASE PRICE OF THE
MATERIALS DESCRIBED HEREIN.
Autodesk, Inc., reserves the right to revise and improve its products as it sees fit.
Autodesk and Open Reality are registered trademarks or trademarks of Autodesk, Inc.,
in the U.S.A. and/or other countries. All other brand names, product names, or
trademarks belong to their respective holders.
GOVERNMENT USE
Use, duplication, or disclosure by the U.S. Government is subject to restrictions as
set forth in FAR 12.212 (Commercial Computer Software-Restricted Rights) and
DFAR 227.7202 (Rights in Technical Data and Computer Software), as applicable.
Manufacturer is Autodesk, Inc., 10 Duke Street, Montreal, Quebec, Canada, H3C 2L7.
***************************************************************************************/
#ifndef __ORCONSTRAINT_3DCURVE_DEFORMER_CONSTRAINT_H__
#define __ORCONSTRAINT_3DCURVE_DEFORMER_CONSTRAINT_H__
#include <fbsdk/fbsdk.h>
// Class name definition
#define ORCONSTRAINT3DCURVEDEFORMER__CLASSNAME ORConstraint3DCurveDeformer
// Class string definition
#define ORCONSTRAINT3DCURVEDEFORMER__CLASSSTR "ORConstraint3DCurveDeformer"
//---------------------------------------------------------------------------------------
// ORConstraint3DCurveDeformer class
//
// A plugin constraint can deforms a Path3D model by adjusting its control points left/right tangents.
//
//---------------------------------------------------------------------------------------
// Maximum number of models to control curve points, and in/out tangents.
#define MAX_POINT_NUMBER 50
class ORConstraint3DCurveDeformer : public FBConstraint
{
FBConstraintDeclare( ORConstraint3DCurveDeformer, FBConstraint );
public:
virtual bool FBCreate();
virtual void FBDestroy();
virtual void SetupAllAnimationNodes();
// ReferenceAddNotify
// + Bind referenced 3d curve.
virtual bool ReferenceAddNotify( int pGroupIndex, FBModel* pModel );
// ReferenceRemoveNotify
// + Unbind referenced 3d curve.
virtual bool ReferenceRemoveNotify( int pGroupIndex, FBModel* pModel );
// AnimationNodeNotify
// + Retrieve referencing model positions
// + Deform 3d curve and update it
virtual bool AnimationNodeNotify (
FBAnimationNode* pAnimationNode,
FBEvaluateInfo* pEvaluateInfo,
FBConstraintInfo* pConstraintInfo
);
// SnapSuggested (Optional)
// + Snap 3d curve to origin point.
virtual void SnapSuggested ();
private:
//�@Store each group index
int mReferenceGroup_3DCurve;
int mReferenceGroup_Point ;
int mReferenceGroup_Point_Tangent_In ;
int mReferenceGroup_Point_Tangent_Out ;
// Store dummy animation node to call AnimationNotify
FBAnimationNode* mDummy_AnimationNode;
// A pointer to 3d curve
FBModelPath3D* m3DCurve;
// A status variable of 3d curve
bool m3DCurve_Valid;
};
#endif