00001 00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXCONSTRAINTAIM_H 00005 #define FBXFILESDK_KFBXPLUGINS_KFBXCONSTRAINTAIM_H 00006 00007 /************************************************************************************** 00008 00009 Copyright (C) 2001 - 2009 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 00071 KFbxTypedProperty<fbxBool1> Lock; 00072 KFbxTypedProperty<fbxBool1> Active; 00073 00074 KFbxTypedProperty<fbxDouble1> Weight; 00075 KFbxTypedProperty<fbxDouble3> RotationOffset; 00076 00079 KFbxTypedProperty<fbxReference> AimAtObjects; 00080 00083 KFbxTypedProperty<fbxReference> ConstrainedObject; 00084 00087 KFbxTypedProperty<fbxEnum> WorldUpType; 00088 00091 KFbxTypedProperty<fbxReference> WorldUpObject; 00092 00097 KFbxTypedProperty<fbxDouble3> WorldUpVector; 00098 00103 KFbxTypedProperty<fbxDouble3> UpVector; 00104 00109 KFbxTypedProperty<fbxDouble3> AimVector; 00110 00115 KFbxTypedProperty<fbxBool1> AffectX; 00116 00121 KFbxTypedProperty<fbxBool1> AffectY; 00122 00127 KFbxTypedProperty<fbxBool1> AffectZ; 00129 00130 00131 public: 00140 typedef enum 00141 { 00142 eAimAtSceneUp, 00143 eAimAtObjectUp, 00144 eAimAtObjectRotationUp, 00145 eAimAtVector, 00146 eAimAtNone, 00147 eAimAtCount 00148 } EAimConstraintWoldUpType; 00149 00153 inline void SetLock(bool pLock) { Lock.Set(pLock); } 00154 00158 inline bool GetLock() { return Lock.Get(); } 00159 00163 inline void SetActive(bool pActive) { Active.Set(pActive); } 00164 00168 inline bool GetActive() { return Active.Get(); } 00169 00173 void SetWeight(double pWeight); 00174 00178 virtual void SetOffset(KFbxVector4 pRotation); 00179 00183 KFbxVector4 GetOffset(); 00184 00188 double GetSourceWeight(KFbxObject* pObject); 00189 00194 void AddConstraintSource(KFbxObject* pObject, double pWeight = 100); 00195 00199 int GetConstraintSourceCount(); 00200 00205 KFbxObject* GetConstraintSource(int pIndex); 00206 00210 void SetConstrainedObject(KFbxObject* pObject); 00211 00215 KFbxObject* GetConstrainedObject(); 00216 00220 void SetWorldUpType(EAimConstraintWoldUpType pType); 00221 00225 EAimConstraintWoldUpType GetWorldUpType(); 00226 00230 void SetWorldUpObject(KFbxObject* pObject); 00231 00235 KFbxObject* GetWorldUpObject(); 00236 00240 void SetWorldUpVector(KFbxVector4 pVector); 00241 00245 KFbxVector4 GetWorldUpVector(); 00246 00250 void SetUpVector(KFbxVector4 pVector); 00251 00255 KFbxVector4 GetUpVector(); 00256 00260 void SetAimVector(KFbxVector4 pVector); 00261 00265 KFbxVector4 GetAimVector(); 00266 00270 inline void SetAffectX(bool pAffect) { AffectX.Set(pAffect); } 00271 00275 inline bool GetAffectX() { return AffectX.Get(); } 00276 00280 inline void SetAffectY(bool pAffect){ AffectY.Set(pAffect); } 00281 00285 inline bool GetAffectY() { return AffectY.Get(); } 00286 00290 inline void SetAffectZ(bool pAffect) { AffectZ.Set(pAffect); } 00291 00295 inline bool GetAffectZ() { return AffectZ.Get(); } 00296 00297 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00298 00299 // Clone 00300 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const; 00301 00302 protected: 00303 00304 KFbxConstraintAim(KFbxSdkManager& pManager, char const* pName); 00305 00306 virtual bool ConstructProperties(bool pForceSet); 00307 00308 virtual EConstraintType GetConstraintType(); 00309 virtual KString GetTypeName() const; 00310 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS 00311 }; 00312 00313 inline EFbxType FbxTypeOf( KFbxConstraintAim::EAimConstraintWoldUpType const &pItem ) { return eENUM; } 00314 00315 #include <fbxfilesdk/fbxfilesdk_nsend.h> 00316 00317 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCONSTRAINTAIM_H 00318