00001 00004 #ifndef _FBXSDK_CONSTRAINT_AIM_H_ 00005 #define _FBXSDK_CONSTRAINT_AIM_H_ 00006 00007 /************************************************************************************** 00008 00009 Copyright © 2001 - 2007 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 <kaydaradef.h> 00043 #ifndef KFBX_DLL 00044 #define KFBX_DLL K_DLLIMPORT 00045 #endif 00046 00047 #include <kaydara.h> 00048 00049 #include <kfbxplugins/kfbxconstraint.h> 00050 #include <kfbxplugins/kfbxgroupname.h> 00051 #include <kfbxmath/kfbxvector4.h> 00052 00053 #include <klib/kerror.h> 00054 00055 #include <fbxfilesdk_nsbegin.h> 00056 00057 class KFbxSdkManager; 00058 class KFbxConstraintAim_internal; 00059 00064 class KFBX_DLL KFbxConstraintAim : public KFbxConstraint 00065 { 00066 KFBXOBJECT_DECLARE(KFbxConstraintAim); 00067 00072 KFbxTypedProperty<fbxBool1> Lock; 00073 KFbxTypedProperty<fbxBool1> Active; 00074 00075 KFbxTypedProperty<fbxDouble1> Weight; 00076 KFbxTypedProperty<fbxDouble3> RotationOffset; 00077 00078 KFbxTypedProperty<fbxReference> AimAtObjects; 00079 KFbxTypedProperty<fbxReference> ConstrainedObject; 00080 00081 KFbxTypedProperty<fbxEnum> WorldUpType; 00082 KFbxTypedProperty<fbxReference> WorldUpObject; 00083 KFbxTypedProperty<fbxDouble3> WorldUpVector; 00084 KFbxTypedProperty<fbxDouble3> UpVector; 00085 KFbxTypedProperty<fbxDouble3> AimVector; 00086 00087 KFbxTypedProperty<fbxBool1> AffectX; 00088 KFbxTypedProperty<fbxBool1> AffectY; 00089 KFbxTypedProperty<fbxBool1> AffectZ; 00091 00092 00093 public: 00094 typedef enum 00095 { 00096 eAimAtSceneUp, 00097 eAimAtObjectUp, 00098 eAimAtObjectRotationUp, 00099 eAimAtVector, 00100 eAimAtNone, 00101 eAimAtCount 00102 } EAimConstraintWoldUpType; 00103 00107 inline void SetLock(bool pLock) { Lock.Set(pLock); } 00108 00112 inline bool GetLock() { return Lock.Get(); } 00113 00117 inline void SetActive(bool pActive) { Active.Set(pActive); } 00118 00122 inline bool GetActive() { return Active.Get(); } 00123 00127 void SetWeight(double pWeight); 00128 00132 virtual void SetOffset(KFbxVector4 pRotation); 00133 00137 KFbxVector4 GetOffset(); 00138 00142 double GetSourceWeight(KFbxObject* pObject); 00143 00148 void AddConstraintSource(KFbxObject* pObject, double pWeight = 100); 00149 00153 int GetConstraintSourceCount(); 00154 00158 KFbxObject* GetConstraintSource(int pIndex); 00159 00163 void SetConstrainedObject(KFbxObject* pObject); 00164 00168 KFbxObject* GetConstrainedObject(); 00169 00173 void SetWorldUpType(EAimConstraintWoldUpType pType); 00174 00178 EAimConstraintWoldUpType GetWorldUpType(); 00179 00183 void SetWorldUpObject(KFbxObject* pObject); 00184 00188 KFbxObject* GetWorldUpObject(); 00189 00193 void SetWorldUpVector(KFbxVector4 pVector); 00194 00198 KFbxVector4 GetWorldUpVector(); 00199 00203 void SetUpVector(KFbxVector4 pVector); 00204 00208 KFbxVector4 GetUpVector(); 00209 00213 void SetAimVector(KFbxVector4 pVector); 00214 00218 KFbxVector4 GetAimVector(); 00219 00223 inline void SetAffectX(bool pAffect) { AffectX.Set(pAffect); } 00224 00228 inline bool GetAffectX() { return AffectX.Get(); } 00229 00233 inline void SetAffectY(bool pAffect){ AffectY.Set(pAffect); } 00234 00238 inline bool GetAffectY() { return AffectY.Get(); } 00239 00243 inline void SetAffectZ(bool pAffect) { AffectZ.Set(pAffect); } 00244 00248 inline bool GetAffectZ() { return AffectZ.Get(); } 00249 00250 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00251 00252 virtual KObject* GetFbxObject_internal(); 00253 virtual KObject const* GetFbxObject_internal() const; 00254 00255 // Clone 00256 virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType) const; 00257 00258 protected: 00259 static char const* GetNamePrefix() { return CONSTRAINT_PREFIX; } 00260 00261 KFbxConstraintAim(KFbxSdkManager& pManager, char const* pName); 00262 ~KFbxConstraintAim(); 00263 00264 virtual void Destruct(bool pRecursive, bool pDependents); 00265 00266 virtual EConstraintType GetConstraintType(); 00267 virtual KString GetTypeName() const; 00268 00269 // Entity manipulation 00270 virtual void AddChannels(KFbxTakeNode *pTakeNode); 00271 00272 KFbxConstraintAim_internal* mPH; 00273 00274 friend class KFbxWriterFbx6; 00275 friend class KFbxReaderFbx; 00276 00277 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS 00278 }; 00279 00280 #include <fbxfilesdk_nsend.h> 00281 00282 #endif // _FBXSDK_CONSTRAINT_AIM_H_ 00283 00284