FBX SDK Reference Guide: kfbxconstraintaim.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXCONSTRAINTAIM_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXCONSTRAINTAIM_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2008 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00044 
00045 #include <fbxfilesdk/kfbxplugins/kfbxconstraint.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxgroupname.h>
00047 #include <fbxfilesdk/kfbxmath/kfbxvector4.h>
00048 
00049 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00050 
00051 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00052 
00053     class KFbxSdkManager;
00054 
00059     class KFBX_DLL KFbxConstraintAim : public KFbxConstraint
00060     {
00061         KFBXOBJECT_DECLARE(KFbxConstraintAim,KFbxConstraint);
00062 
00067             KFbxTypedProperty<fbxBool1>     Lock;
00068             KFbxTypedProperty<fbxBool1>     Active;
00069 
00070             KFbxTypedProperty<fbxDouble1>   Weight;
00071             KFbxTypedProperty<fbxDouble3>   RotationOffset;
00072 
00073             KFbxTypedProperty<fbxReference> AimAtObjects;
00074             KFbxTypedProperty<fbxReference> ConstrainedObject;
00075 
00076             KFbxTypedProperty<fbxEnum>      WorldUpType;
00077             KFbxTypedProperty<fbxReference> WorldUpObject;
00078             KFbxTypedProperty<fbxDouble3>   WorldUpVector;
00079             KFbxTypedProperty<fbxDouble3>   UpVector;
00080             KFbxTypedProperty<fbxDouble3>   AimVector;
00081             
00082             KFbxTypedProperty<fbxBool1>     AffectX;
00083             KFbxTypedProperty<fbxBool1>     AffectY;
00084             KFbxTypedProperty<fbxBool1>     AffectZ;
00086         
00087 
00088     public:
00089         typedef enum 
00090         {
00091             eAimAtSceneUp,
00092             eAimAtObjectUp,
00093             eAimAtObjectRotationUp,
00094             eAimAtVector,
00095             eAimAtNone,
00096             eAimAtCount
00097         } EAimConstraintWoldUpType;
00098 
00102         inline void SetLock(bool pLock) { Lock.Set(pLock); }
00103 
00107         inline bool GetLock()           { return Lock.Get(); }
00108 
00112         inline void SetActive(bool pActive) { Active.Set(pActive); }
00113 
00117         inline bool GetActive() { return Active.Get(); }
00118 
00122         void SetWeight(double pWeight);
00123 
00127         virtual void SetOffset(KFbxVector4 pRotation);
00128 
00132         KFbxVector4 GetOffset();
00133 
00137         double GetSourceWeight(KFbxObject* pObject);
00138 
00143         void AddConstraintSource(KFbxObject* pObject, double pWeight = 100);
00144 
00148         int GetConstraintSourceCount();
00149 
00154         KFbxObject* GetConstraintSource(int pIndex);
00155 
00159         void SetConstrainedObject(KFbxObject* pObject);
00160 
00164         KFbxObject* GetConstrainedObject();
00165 
00169         void SetWorldUpType(EAimConstraintWoldUpType pType);
00170 
00174         EAimConstraintWoldUpType GetWorldUpType();
00175 
00179         void SetWorldUpObject(KFbxObject* pObject);
00180 
00184         KFbxObject* GetWorldUpObject();
00185 
00189         void SetWorldUpVector(KFbxVector4 pVector);
00190 
00194         KFbxVector4 GetWorldUpVector();
00195 
00199         void SetUpVector(KFbxVector4 pVector);
00200 
00204         KFbxVector4 GetUpVector();
00205 
00209         void SetAimVector(KFbxVector4 pVector);
00210 
00214         KFbxVector4 GetAimVector();
00215 
00219         inline void SetAffectX(bool pAffect) { AffectX.Set(pAffect); }
00220 
00224         inline bool GetAffectX() { return AffectX.Get(); }
00225 
00229         inline void SetAffectY(bool pAffect){ AffectY.Set(pAffect); }
00230 
00234         inline bool GetAffectY() { return AffectY.Get(); }
00235 
00239         inline void SetAffectZ(bool pAffect) { AffectZ.Set(pAffect); }
00240 
00244         inline bool GetAffectZ() { return AffectZ.Get(); }
00245 
00246     #ifndef DOXYGEN_SHOULD_SKIP_THIS
00247 
00248         // Clone
00249     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00250 
00251     protected:
00252 
00253         KFbxConstraintAim(KFbxSdkManager& pManager, char const* pName);
00254         ~KFbxConstraintAim();
00255 
00256         virtual bool ConstructProperties(bool pForceSet);
00257         virtual void Destruct(bool pRecursive, bool pDependents);
00258 
00259         virtual EConstraintType GetConstraintType();
00260         virtual KString GetTypeName() const;
00261     #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00262     };
00263 
00264 inline EFbxType FbxTypeOf( KFbxConstraintAim::EAimConstraintWoldUpType const &pItem )               { return eENUM; }
00265 
00266 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00267 
00268 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCONSTRAINTAIM_H
00269