| 1 | /**************************************************************************************** |
| 2 | |
| 3 | Copyright (C) 2015 Autodesk, Inc. |
| 4 | All rights reserved. |
| 5 | |
| 6 | Use of this software is subject to the terms of the Autodesk license agreement |
| 7 | provided at the time of installation or download, or which otherwise accompanies |
| 8 | this software in either electronic or hard copy form. |
| 9 | |
| 10 | ****************************************************************************************/ |
| 11 | |
| 12 | //! \file fbxconstraintaim.h |
| 13 | #ifndef _FBXSDK_SCENE_CONSTRAINT_AIM_H_ |
| 14 | #define _FBXSDK_SCENE_CONSTRAINT_AIM_H_ |
| 15 | |
| 16 | #include <fbxsdk/fbxsdk_def.h> |
| 17 | |
| 18 | #include <fbxsdk/scene/constraint/fbxconstraint.h> |
| 19 | |
| 20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
| 21 | |
| 22 | /** An aim constraint governs an object's orientation so that the object points to other objects. |
| 23 | * For example, you can use the aim constraint to point a light at an object or group of objects. |
| 24 | * \nosubgrouping |
| 25 | */ |
| 26 | class FBXSDK_DLL FbxConstraintAim : public FbxConstraint |
| 27 | { |
| 28 | FBXSDK_OBJECT_DECLARE(FbxConstraintAim, FbxConstraint); |
| 29 | |
| 30 | public: |
| 31 | /** \enum EWorldUp Constraint world up type, which has the same meaning with Maya. |
| 32 | */ |
| 33 | enum EWorldUp |
| 34 | { |
| 35 | eAimAtSceneUp, //! Constraint scene up type. |
| 36 | eAimAtObjectUp, //! Constraint object up type. |
| 37 | eAimAtObjectRotationUp, //! Constraint object rotation up type. |
| 38 | eAimAtVector, //! Constraint vector type. |
| 39 | eAimAtNone, //! None constraint type. |
| 40 | eAimAtCount //! Constraint world up type count. |
| 41 | }; |
| 42 | |
| 43 | /** |
| 44 | * \name Properties |
| 45 | */ |
| 46 | //@{ |
| 47 | /** This property handles the rotation offset value. |
| 48 | * |
| 49 | * Default value is (0, 0, 0). |
| 50 | */ |
| 51 | FbxPropertyT<FbxDouble3> RotationOffset; |
| 52 | |
| 53 | /** This property provides access to the object or objects which are the targets. |
| 54 | */ |
| 55 | FbxPropertyT<FbxReference> AimAtObjects; |
| 56 | |
| 57 | /** This property provides access to the object being aimed. |
| 58 | */ |
| 59 | FbxPropertyT<FbxReference> ConstrainedObject; |
| 60 | |
| 61 | /** This property handles world up type. |
| 62 | */ |
| 63 | FbxPropertyT<FbxEnum> WorldUpType; |
| 64 | |
| 65 | /** This property handles world up object. |
| 66 | */ |
| 67 | FbxPropertyT<FbxReference> WorldUpObject; |
| 68 | |
| 69 | /** This property handles world up vector. |
| 70 | * |
| 71 | * Default value is (0, 1, 0). |
| 72 | */ |
| 73 | FbxPropertyT<FbxDouble3> WorldUpVector; |
| 74 | |
| 75 | /** This property handles up vector. |
| 76 | * |
| 77 | * Default value is (0, 1, 0). |
| 78 | */ |
| 79 | FbxPropertyT<FbxDouble3> UpVector; |
| 80 | |
| 81 | /** This property enables you set a specific axis for the constrained object to orient towards. |
| 82 | * |
| 83 | * Default value is (1, 0, 0). |
| 84 | */ |
| 85 | FbxPropertyT<FbxDouble3> AimVector; |
| 86 | |
| 87 | /** This property handles whether to affect the rotation around X axis. |
| 88 | * |
| 89 | * Default value is true. |
| 90 | */ |
| 91 | FbxPropertyT<FbxBool> AffectX; |
| 92 | |
| 93 | /** This property handles whether to affect the rotation around Y axis. |
| 94 | * |
| 95 | * Default value is true. |
| 96 | */ |
| 97 | FbxPropertyT<FbxBool> AffectY; |
| 98 | |
| 99 | /** This property handles whether to affect the rotation around Z axis. |
| 100 | * |
| 101 | * Default value is true. |
| 102 | */ |
| 103 | FbxPropertyT<FbxBool> AffectZ; |
| 104 | //@} |
| 105 | |
| 106 | /** Add a source to the constraint. |
| 107 | * \param pObject New source object. |
| 108 | * \param pWeight Weight of the source object. |
| 109 | */ |
| 110 | void AddConstraintSource(FbxObject* pObject, double pWeight = 100); |
| 111 | |
| 112 | /** Retrieve the constraint source count. |
| 113 | * \return Current constraint source count. |
| 114 | */ |
| 115 | int GetConstraintSourceCount() const; |
| 116 | |
| 117 | /** Retrieve a constraint source object. |
| 118 | * \param pIndex The specified index. |
| 119 | * \return Current source at the specified index. |
| 120 | */ |
| 121 | FbxObject* GetConstraintSource(int pIndex) const; |
| 122 | |
| 123 | /** Set the constrained object. |
| 124 | * \param pObject The constrained object. |
| 125 | */ |
| 126 | void SetConstrainedObject(FbxObject* pObject); |
| 127 | |
| 128 | /** Retrieve the constrained object. |
| 129 | * \return Current constrained object. |
| 130 | */ |
| 131 | FbxObject* GetConstrainedObject() const; |
| 132 | |
| 133 | /** Set the world up object. |
| 134 | * \param pObject The new world up object. |
| 135 | */ |
| 136 | void SetWorldUpObject(FbxObject* pObject); |
| 137 | |
| 138 | /** Retrieve the world up object. |
| 139 | * \return The current world up object. |
| 140 | */ |
| 141 | FbxObject* GetWorldUpObject() const; |
| 142 | |
| 143 | /***************************************************************************************************************************** |
| 144 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
| 145 | *****************************************************************************************************************************/ |
| 146 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 147 | protected: |
| 148 | virtual void ConstructProperties(bool pForceSet); |
| 149 | |
| 150 | virtual EType GetConstraintType() const; |
| 151 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
| 152 | }; |
| 153 | |
| 154 | inline EFbxType FbxTypeOf(const FbxConstraintAim::EWorldUp&){ return eFbxEnum; } |
| 155 | |
| 156 | #include <fbxsdk/fbxsdk_nsend.h> |
| 157 | |
| 158 | #endif /* _FBXSDK_SCENE_CONSTRAINT_AIM_H_ */ |
| 159 | |