FBX SDK Reference Guide: kfbxconstraintaim.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_CONSTRAINT_AIM_H_
00005 #define _FBXSDK_CONSTRAINT_AIM_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 <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 
00063     class KFBX_DLL KFbxConstraintAim : public KFbxConstraint
00064     {
00065         KFBXOBJECT_DECLARE(KFbxConstraintAim,KFbxConstraint);
00066 
00071             KFbxTypedProperty<fbxBool1>     Lock;
00072             KFbxTypedProperty<fbxBool1>     Active;
00073 
00074             KFbxTypedProperty<fbxDouble1>   Weight;
00075             KFbxTypedProperty<fbxDouble3>   RotationOffset;
00076 
00077             KFbxTypedProperty<fbxReference> AimAtObjects;
00078             KFbxTypedProperty<fbxReference> ConstrainedObject;
00079 
00080             KFbxTypedProperty<fbxEnum>      WorldUpType;
00081             KFbxTypedProperty<fbxReference> WorldUpObject;
00082             KFbxTypedProperty<fbxDouble3>   WorldUpVector;
00083             KFbxTypedProperty<fbxDouble3>   UpVector;
00084             KFbxTypedProperty<fbxDouble3>   AimVector;
00085             
00086             KFbxTypedProperty<fbxBool1>     AffectX;
00087             KFbxTypedProperty<fbxBool1>     AffectY;
00088             KFbxTypedProperty<fbxBool1>     AffectZ;
00090         
00091 
00092     public:
00093         typedef enum 
00094         {
00095             eAimAtSceneUp,
00096             eAimAtObjectUp,
00097             eAimAtObjectRotationUp,
00098             eAimAtVector,
00099             eAimAtNone,
00100             eAimAtCount
00101         } EAimConstraintWoldUpType;
00102 
00106         inline void SetLock(bool pLock) { Lock.Set(pLock); }
00107 
00111         inline bool GetLock()           { return Lock.Get(); }
00112 
00116         inline void SetActive(bool pActive) { Active.Set(pActive); }
00117 
00121         inline bool GetActive() { return Active.Get(); }
00122 
00126         void SetWeight(double pWeight);
00127 
00131         virtual void SetOffset(KFbxVector4 pRotation);
00132 
00136         KFbxVector4 GetOffset();
00137 
00141         double GetSourceWeight(KFbxObject* pObject);
00142 
00147         void AddConstraintSource(KFbxObject* pObject, double pWeight = 100);
00148 
00152         int GetConstraintSourceCount();
00153 
00157         KFbxObject* GetConstraintSource(int pIndex);
00158 
00162         void SetConstrainedObject(KFbxObject* pObject);
00163 
00167         KFbxObject* GetConstrainedObject();
00168 
00172         void SetWorldUpType(EAimConstraintWoldUpType pType);
00173 
00177         EAimConstraintWoldUpType GetWorldUpType();
00178 
00182         void SetWorldUpObject(KFbxObject* pObject);
00183 
00187         KFbxObject* GetWorldUpObject();
00188 
00192         void SetWorldUpVector(KFbxVector4 pVector);
00193 
00197         KFbxVector4 GetWorldUpVector();
00198 
00202         void SetUpVector(KFbxVector4 pVector);
00203 
00207         KFbxVector4 GetUpVector();
00208 
00212         void SetAimVector(KFbxVector4 pVector);
00213 
00217         KFbxVector4 GetAimVector();
00218 
00222         inline void SetAffectX(bool pAffect) { AffectX.Set(pAffect); }
00223 
00227         inline bool GetAffectX() { return AffectX.Get(); }
00228 
00232         inline void SetAffectY(bool pAffect){ AffectY.Set(pAffect); }
00233 
00237         inline bool GetAffectY() { return AffectY.Get(); }
00238 
00242         inline void SetAffectZ(bool pAffect) { AffectZ.Set(pAffect); }
00243 
00247         inline bool GetAffectZ() { return AffectZ.Get(); }
00248 
00249     #ifndef DOXYGEN_SHOULD_SKIP_THIS
00250 
00251         // Clone
00252     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00253 
00254     protected:
00255 
00256         KFbxConstraintAim(KFbxSdkManager& pManager, char const* pName);
00257         ~KFbxConstraintAim();
00258 
00259         virtual bool ConstructProperties(bool pForceSet);
00260         virtual void Destruct(bool pRecursive, bool pDependents);
00261 
00262         virtual EConstraintType GetConstraintType();
00263         virtual KString GetTypeName() const;
00264 
00265         friend class KFbxWriterFbx6;
00266         friend class KFbxReaderFbx;
00267 
00268     #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00269     };
00270 
00271 inline EFbxType FbxTypeOf( KFbxConstraintAim::EAimConstraintWoldUpType const &pItem )               { return eENUM; }
00272 
00273 #include <fbxfilesdk_nsend.h>
00274 
00275 #endif // _FBXSDK_CONSTRAINT_AIM_H_
00276 
00277