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 fbxconstraintparent.h
13#ifndef _FBXSDK_SCENE_CONSTRAINT_PARENT_H_
14#define _FBXSDK_SCENE_CONSTRAINT_PARENT_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/** The parent constraint creates a parent-to-child relationship between any two objects, from any two hierarchies.
23 * It creates the same relationship as the parent-to-child relationships found in hierarchies.
24 * You can use this constraint to connect objects without changing hierarchies.
25 * \nosubgrouping
26 */
27class FBXSDK_DLL FbxConstraintParent : public FbxConstraint
28{
29 FBXSDK_OBJECT_DECLARE(FbxConstraintParent, FbxConstraint);
30
31public:
32 /**
33 * \name Properties
34 */
35 //@{
36 /** This property handles whether to affect the translation of the constrained object along X axis.
37 *
38 * Default value is true.
39 */
40 FbxPropertyT<FbxBool> AffectTranslationX;
41
42 /** This property handles whether to affect the translation of the constrained object along Y axis.
43 *
44 * Default value is true.
45 */
46 FbxPropertyT<FbxBool> AffectTranslationY;
47
48 /** This property handles whether to affect the translation of the constrained object along Z axis.
49 *
50 * Default value is true.
51 */
52 FbxPropertyT<FbxBool> AffectTranslationZ;
53
54 /** This property handles whether to affect the rotation of the constrained object around X axis.
55 *
56 * Default value is true.
57 */
58 FbxPropertyT<FbxBool> AffectRotationX;
59
60 /** This property handles whether to affect the rotation of the constrained object around Y axis.
61 *
62 * Default value is true.
63 */
64 FbxPropertyT<FbxBool> AffectRotationY;
65
66 /** This property handles whether to affect the rotation of the constrained object around Z axis.
67 *
68 * Default value is true.
69 */
70 FbxPropertyT<FbxBool> AffectRotationZ;
71
72 /** This property handles whether to affect the scaling of the constrained object along X axis.
73 *
74 * Default value is true.
75 */
76 FbxPropertyT<FbxBool> AffectScalingX;
77
78 /** This property handles whether to affect the scaling of the constrained object along Y axis.
79 *
80 * Default value is true.
81 */
82 FbxPropertyT<FbxBool> AffectScalingY;
83
84 /** This property handles whether to affect the scaling of the constrained object along Z axis.
85 *
86 * Default value is true.
87 */
88 FbxPropertyT<FbxBool> AffectScalingZ;
89
90 /** This property used to access constraint sources.
91 * A constrained object is an object whose position, orientation, and so on is driven by one or more constraint sources.
92 */
93 FbxPropertyT<FbxReference> ConstraintSources;
94
95 /** This property used to access constrained object.
96 * A constrained object is an object whose position, orientation, and so on is driven by one or more constraint sources.
97 */
98 FbxPropertyT<FbxReference> ConstrainedObject;
99 //@}
100
101 /** Set the translation offset of the specified constraint source.
102 * \param pObject The specified constraint source.
103 * \param pTranslation The new offset vector.
104 */
105 void SetTranslationOffset(FbxObject* pObject, FbxVector4 pTranslation);
106
107 /** Retrieve the translation offset of the specified constraint source.
108 * \param pObject The specified constraint source.
109 * \return The current translation offset.
110 */
111 FbxVector4 GetTranslationOffset(const FbxObject* pObject) const;
112
113 /** Set the rotation offset of the specified constraint source.
114 * \param pObject The specified constraint source.
115 * \param pRotation The new offset vector.
116 */
117 virtual void SetRotationOffset(const FbxObject* pObject, FbxVector4 pRotation);
118
119 /** Retrieve the rotation offset of the specified constraint source.
120 * \param pObject The specified constraint source.
121 * \return The current translation offset.
122 */
123 FbxVector4 GetRotationOffset(const FbxObject* pObject) const;
124
125 /** Add a constraint source to the constraint.
126 * \param pObject New constraint source.
127 * \param pWeight Weight of the constraint source.
128 */
129 void AddConstraintSource(FbxObject* pObject, double pWeight = 100);
130
131 /** Retrieve the constraint source count.
132 * \return Current constraint source count.
133 */
134 int GetConstraintSourceCount() const;
135
136 /** Retrieve a constraint source object.
137 * \param pIndex Index of the constraint source.
138 * \return The constraint source at the specified index.
139 */
140 FbxObject* GetConstraintSource(int pIndex) const;
141
142 /** Set the constrained object.
143 * \param pObject The constrained object.
144 */
145 void SetConstrainedObject(FbxObject* pObject);
146
147 /** Retrieve the constrained object.
148 * \return Current constrained object.
149 */
150 FbxObject* GetConstrainedObject() const;
151
152/*****************************************************************************************************************************
153** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
154*****************************************************************************************************************************/
155#ifndef DOXYGEN_SHOULD_SKIP_THIS
156protected:
157 virtual void ConstructProperties(bool pForceSet);
158 virtual EType GetConstraintType() const;
159#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
160};
161
162#include <fbxsdk/fbxsdk_nsend.h>
163
164#endif /* _FBXSDK_SCENE_CONSTRAINT_PARENT_H_ */
165