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 fbxnode.h |
13 | #ifndef _FBXSDK_SCENE_GEOMETRY_NODE_H_ |
14 | #define _FBXSDK_SCENE_GEOMETRY_NODE_H_ |
15 | |
16 | #include <fbxsdk/fbxsdk_def.h> |
17 | |
18 | #include <fbxsdk/core/fbxobject.h> |
19 | #include <fbxsdk/core/math/fbxtransforms.h> |
20 | |
21 | #include <fbxsdk/fbxsdk_nsbegin.h> |
22 | |
23 | class FbxStatus; |
24 | class FbxNodeAttribute; |
25 | class FbxCachedEffect; |
26 | class FbxLODGroup; |
27 | class FbxNull; |
28 | class FbxMarker; |
29 | class FbxSkeleton; |
30 | class FbxGeometry; |
31 | class FbxMesh; |
32 | class FbxNurbs; |
33 | class FbxNurbsCurve; |
34 | class FbxLine; |
35 | class FbxNurbsSurface; |
36 | class FbxTrimNurbsSurface; |
37 | class FbxPatch; |
38 | class FbxCamera; |
39 | class FbxCameraStereo; |
40 | class FbxCameraSwitcher; |
41 | class FbxLight; |
42 | class FbxOpticalReference; |
43 | class FbxSubDiv; |
44 | class FbxCharacter; |
45 | class FbxSurfaceMaterial; |
46 | class FbxAnimStack; |
47 | class FbxAnimCurveFilterMatrixConverter; |
48 | |
49 | /** Represents an element in the scene graph. A scene graph is a tree of FbxNode |
50 | * objects. The tree management services are self contained in this class. |
51 | * |
52 | * \note The FBX SDK does not test the validity of the constructed scene graph. It |
53 | * is the responsibility of the caller to make sure that it does not generate cyclic |
54 | * graphs in a node hierarchy. |
55 | * |
56 | * Besides the tree management, this class defines all the properties required to describe |
57 | * the position of the object in the scene. This information include the basic Translation, |
58 | * Rotation and Scaling properties and the more advanced options for pivots, limits, and IK joints |
59 | * attributes such the stiffness and dampening. |
60 | * |
61 | * When it is first created, the FbxNode object is "empty" (i.e: it is an object without any |
62 | * graphical representation that only contains the position information). In this state, it can |
63 | * be used to represent parents in the node tree structure but not much more. The normal use of |
64 | * this type of objects is to add them an attribute that will specialize the node (see the |
65 | * "Node Attribute Management" section). |
66 | * |
67 | * The node attribute is an object in itself and is connected to the the FbxNode. This also |
68 | * means that the same node attribute can be shared among multiple nodes. FbxCamera, FbxLight, |
69 | * FbxMesh, etc... are all node attributes and they all derive from the base class FbxNodeAttribute. |
70 | * |
71 | */ |
72 | class FBXSDK_DLL FbxNode : public FbxObject |
73 | { |
74 | FBXSDK_OBJECT_DECLARE(FbxNode, FbxObject); |
75 | |
76 | public: |
77 | /** |
78 | * \name Node Tree Management |
79 | */ |
80 | //@{ |
81 | /** Get the parent node. |
82 | * \return Pointer to parent node or \c NULL if the current node has no parent. |
83 | */ |
84 | FbxNode* GetParent(); |
85 | const FbxNode* GetParent() const; |
86 | |
87 | /** Add a child node and its underlying node tree. |
88 | * \param pNode Node we want to make child of \c this. |
89 | * \return \c true on success, \c false if \e pNode is \c NULL or the system is |
90 | * unable to make the connection. |
91 | * \remarks If \e pNode already has a parent, first it is removed from current parent and then |
92 | * added to this one. |
93 | */ |
94 | bool AddChild(FbxNode* pNode); |
95 | |
96 | /** Remove the child node. |
97 | * \param pNode The child node to be removed. |
98 | * \return The removed child node. |
99 | */ |
100 | FbxNode* RemoveChild(FbxNode* pNode); |
101 | |
102 | /** Get the number of children nodes. |
103 | * \param pRecursive If \c true the method will also count all the descendant children. |
104 | * \return Total number of children for this node. |
105 | */ |
106 | int GetChildCount(bool pRecursive = false) const; |
107 | |
108 | /** Get child by index. |
109 | * \param pIndex The child index. |
110 | * \return Child node or \c NULL if \e pIndex is out of range (i.e: < 0 or > GetChildCount()). |
111 | */ |
112 | FbxNode* GetChild(int pIndex); |
113 | |
114 | /** Get child by index. |
115 | * \param pIndex The child index. |
116 | * \return Child node or \c NULL if \e pIndex is out of range (i.e: < 0 or > GetChildCount()). |
117 | */ |
118 | const FbxNode* GetChild(int pIndex) const; |
119 | |
120 | /** Finds a child node by name. |
121 | * \param pName Name of the searched child node. |
122 | * \param pRecursive Flag to request recursive calls. |
123 | * \param pInitial If set to \c true, the search compares the initial name of |
124 | * the node (see the FbxObject class) |
125 | * \return Found child node or \c NULL if no child node with this name exists. |
126 | */ |
127 | FbxNode* FindChild(const char* pName, bool pRecursive=true, bool pInitial=false); |
128 | //@} |
129 | |
130 | /** |
131 | * \name Node Target Management |
132 | * The FbxNode class allows the client to set a "follow" target node. This target |
133 | * forces the node to re-align itself so it points to the target. By default, the node |
134 | * uses its X axis as the aiming constraint. A rotation offset can be added to change |
135 | * this behavior. While the default relative orientation to the target (the X axis) is |
136 | * sufficient for the FBX cameras (with a (0,0,0) rotation vector, they are aiming |
137 | * along the X axis), this rotation offset becomes particularly useful with the lights |
138 | * objects because their default orientation (when they have a 0,0,0 rotation vector) is to |
139 | * point along the -Y axis and they need to be adjusted with a 90-degree offset on the Z axis. |
140 | * |
141 | * The FbxNode class also permits the use of node to define an Up-vector. By default, |
142 | * the node's up vector points towards the Up node. If the Up node is not specified, |
143 | * then the node's Up vector points towards the Y axis. Here too, a rotation offset can be |
144 | * added to change the default behavior. |
145 | * |
146 | * Of course, these offsets can be applied to anything, not only the cameras and lights. |
147 | * |
148 | * \note Objects in the FBX SDK are always created in the right handed, Y-Up system and need |
149 | * to be adjusted for any other axis system by explicitly convert them (the class |
150 | * FbxAxisSystem can help in that process). |
151 | * |
152 | */ |
153 | //@{ |
154 | /** The target must be part of the same scene and it cannot be itself. |
155 | * \param pNode The target. |
156 | */ |
157 | void SetTarget(FbxNode* pNode); |
158 | |
159 | /** Get the target for this node. |
160 | * \returns \c NULL if target isn't set. |
161 | */ |
162 | FbxNode* GetTarget() const; |
163 | |
164 | /** Set rotation offset from default relative orientation to target. |
165 | * \param pVector The rotation offset. |
166 | */ |
167 | void SetPostTargetRotation(FbxVector4 pVector); |
168 | |
169 | /** Get rotation offset from default relative orientation to target. |
170 | * \return The rotation offset. |
171 | */ |
172 | FbxVector4 GetPostTargetRotation() const; |
173 | |
174 | /** The target up node must be part of the same scene and it cannot be itself. |
175 | * \param pNode The target. |
176 | */ |
177 | void SetTargetUp(FbxNode* pNode); |
178 | |
179 | /** Get the target up node. |
180 | * \return \c NULL if the target up model isn't set. |
181 | */ |
182 | FbxNode* GetTargetUp() const; |
183 | |
184 | /** Set up vector offset from default relative target up vector. |
185 | * \param pVector The rotation offset. |
186 | */ |
187 | void SetTargetUpVector(FbxVector4 pVector); |
188 | |
189 | /** Get up vector offset from default relative target up vector. |
190 | * \return The up vector offset. |
191 | */ |
192 | FbxVector4 GetTargetUpVector() const; |
193 | //@} |
194 | |
195 | /** |
196 | * \name Node Display Parameters |
197 | */ |
198 | //@{ |
199 | /** Set the node Visibility value from the boolean parameter. |
200 | * \param pIsVisible Node is visible in the scene if set to \c true. |
201 | * \remarks This method checks for the validity of the property before attempting to |
202 | * set its value. In fact, the exact same result can be achieved by the following code: |
203 | * \code |
204 | * if( Visibility.IsValid() ) |
205 | * { |
206 | * Visibility.Set(FbxDouble(pIsVisible)); |
207 | * } |
208 | * \endcode |
209 | * |
210 | * \see Visibility property. |
211 | */ |
212 | void SetVisibility(bool pIsVisible); |
213 | |
214 | /** Get the current value of the Visibility property. |
215 | * \return \c false if the Visibility property value is 0.0 and \c true for any other value. |
216 | * \remarks This method expects the Visibility property to exist and to be valid. If this |
217 | * condition is not met, the returned value will be \c false. |
218 | */ |
219 | bool GetVisibility() const; |
220 | |
221 | /** \enum EShadingMode Shading modes. |
222 | * These shading modes are not directly used by the FBX SDK but it is guaranteed that the information is |
223 | * carried to and from the FBX files. The typical context of using these modes is to affect the rendering of |
224 | * geometric objects (this is, of course, performed at the application level) and the possible definition |
225 | * for each mode is: |
226 | */ |
227 | enum EShadingMode |
228 | { |
229 | eHardShading, //!< Solid geometries rendered with smooth surfaces - using the system light. |
230 | eWireFrame, //!< Geometries displayed in wire frame. |
231 | eFlatShading, //!< Solid geometries rendered faceted - using the system light. |
232 | eLightShading, //!< Solid geometries rendered with the scene lights. |
233 | eTextureShading, //!< Solid geometries rendered with smooth textured surfaces - using system light. |
234 | eFullShading //!< Solid geometries rendered with smooth textured surfaces and scene lights. |
235 | }; |
236 | |
237 | /** Set the shading mode. |
238 | * \param pShadingMode The shading mode. |
239 | */ |
240 | void SetShadingMode(EShadingMode pShadingMode); |
241 | |
242 | /** Get the shading mode. |
243 | * \return The currently set shading mode. |
244 | */ |
245 | EShadingMode GetShadingMode() const; |
246 | //@} |
247 | |
248 | /** |
249 | * \name Node Attribute Management |
250 | */ |
251 | //@{ |
252 | /** Set the node attribute. |
253 | * \param pNodeAttribute Node attribute object |
254 | * \return Pointer to previous node attribute object. |
255 | * \c NULL if the node didn't have a node attribute or if |
256 | * the new node attribute is equal to the one currently set. |
257 | * \remarks A node attribute can be shared between nodes. |
258 | * \remarks If this node has more than one attribute (added via the AddAttribute() method), this call |
259 | * will destroy all, but the default node attribute. |
260 | */ |
261 | FbxNodeAttribute* SetNodeAttribute(FbxNodeAttribute* pNodeAttribute); |
262 | |
263 | /** Get the default node attribute. |
264 | * The default node attribute is the attribute that has been set by the call to SetNodeAttribute(). |
265 | * \return Pointer to the default node attribute or \c NULL if the node doesn't |
266 | * have a node attribute. |
267 | */ |
268 | FbxNodeAttribute* GetNodeAttribute(); |
269 | |
270 | /** Get the default node attribute. |
271 | * The default node attribute is the attribute that has been set by the call to SetNodeAttribute(...). |
272 | * \return Pointer to the default node attribute or \c NULL if the node doesn't |
273 | * have a node attribute. |
274 | */ |
275 | const FbxNodeAttribute* GetNodeAttribute() const; |
276 | |
277 | //! Get the number of node attribute(s) connected to this node. |
278 | int GetNodeAttributeCount() const; |
279 | |
280 | /** Get the index, in the list of connected node attributes, of the node attribute that is set |
281 | * to be the default one. |
282 | * \return Index of the default node attribute or \c -1 if there is no default node attribute set. |
283 | */ |
284 | int GetDefaultNodeAttributeIndex() const; |
285 | |
286 | /** Set index of the default node attribute. |
287 | * \param pIndex Identifies which of the connected node attributes is becoming the default one. |
288 | * This value represent the connection number of the node. |
289 | * \param pStatus The FbxStatus object to hold error codes. |
290 | * \return \c true if the operation succeeds or \c false if the passed index is invalid. |
291 | */ |
292 | bool SetDefaultNodeAttributeIndex(int pIndex, FbxStatus* pStatus = NULL); |
293 | |
294 | /** Get the connected node attribute by specifying its index in the connection list. |
295 | * \param pIndex The connection number of the node. |
296 | * \return Pointer to corresponding node attribute or \c NULL if the index is out of range. |
297 | */ |
298 | FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex); |
299 | |
300 | /** Get the connected node attribute by specifying its index in the connection list. |
301 | * \param pIndex The connection number of the node. |
302 | * \return Pointer to corresponding node attribute or \c NULL if the index is out of range. |
303 | */ |
304 | const FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex) const; |
305 | |
306 | /** Get the connection index of the specified node attribute. |
307 | * This method will do a linear search of all the connected node attributes (from the last to |
308 | * the first connection) until it finds \e pNodeAttribue. |
309 | * \param pNodeAttribute The pointer to the node attribute. |
310 | * \param pStatus The FbxStatus object to hold error codes. |
311 | * \return The connection number of the node attribute or \c -1 if pNodeAttribute is \c NULL |
312 | * or not connected to this node. |
313 | */ |
314 | int GetNodeAttributeIndex(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL) const; |
315 | |
316 | /** Add the new node attribute to this node. |
317 | * If no other node attribute is already set as the default one, this new node attribute is |
318 | * automatically set as the default one. |
319 | * \param pNodeAttribute The pointer to a node attribute. |
320 | * \param pStatus The FbxStatus object to hold error codes. |
321 | * \return \c true if the operation succeeded or \c false if the operation failed. |
322 | * \remarks The failing conditions for this methods are: |
323 | * - The received object pointer is \c NULL. |
324 | * - The received object is already connected to this node. |
325 | * - An internal error prevented the connection to successfully complete. |
326 | */ |
327 | bool AddNodeAttribute(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL); |
328 | |
329 | /** Remove the node attribute from the connection list of this node. |
330 | * \param pNodeAttribute The pointer to a node attribute. |
331 | * \return Pointer to the removed node attribute or \c NULL if the operation failed. |
332 | */ |
333 | FbxNodeAttribute* RemoveNodeAttribute(FbxNodeAttribute* pNodeAttribute); |
334 | |
335 | /** Remove the node attribute, specified by the connection index, from the connection |
336 | * list of this node. |
337 | * \param pIndex Index of the node attribute. |
338 | * \return Pointer to the removed node attribute or \c NULL if the operation failed. |
339 | * \remarks If the specified node attribute is also the default one, its predecessor in |
340 | * the connection list will become the new default node attribute. And if there |
341 | * are no more predecessors, the node DefaultNodeAttributeIndex is reset to -1. |
342 | */ |
343 | FbxNodeAttribute* RemoveNodeAttributeByIndex(int pIndex); |
344 | |
345 | /** Get the default node attribute casted to a FbxCachedEffect pointer. |
346 | * \return Pointer to the cached effect object. |
347 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
348 | * be successfully casted, this method will return \c NULL. |
349 | */ |
350 | FbxCachedEffect* GetCachedEffect(); |
351 | |
352 | /** Get the default node attribute casted to a FbxLODGroup pointer. |
353 | * \return Pointer to the lod group object. |
354 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
355 | * be successfully casted, this method will return \c NULL. |
356 | */ |
357 | FbxLODGroup* GetLodGroup(); |
358 | |
359 | /** Get the default node attribute casted to a FbxNull pointer. |
360 | * \return Pointer to the null object. |
361 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
362 | * be successfully casted, this method will return \c NULL. |
363 | */ |
364 | FbxNull* GetNull(); |
365 | |
366 | /** Get the node attribute casted to a FbxMarker pointer. |
367 | * \return Pointer to the marker object. |
368 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
369 | * be successfully casted, this method will return \c NULL. |
370 | */ |
371 | FbxMarker* GetMarker(); |
372 | |
373 | /** Get the node attribute casted to a FbxSkeleton pointer. |
374 | * \return Pointer to the skeleton object. |
375 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
376 | * be successfully casted, this method will return \c NULL. |
377 | */ |
378 | FbxSkeleton* GetSkeleton(); |
379 | |
380 | /** Get the node attribute casted to a FbxGeometry pointer. |
381 | * \return Pointer to the geometry object. |
382 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
383 | * be successfully casted, this method will return \c NULL. |
384 | * \remarks For this method to succeed, the node attribute's GetAttributeType() must returns one of the |
385 | * following: |
386 | * - FbxNodeAttribute::eMesh |
387 | * - FbxNodeAttribute::eNurbs |
388 | * - FbxNodeAttribute::eNurbsSurface |
389 | * - FbxNodeAttribute::ePatch |
390 | * - FbxNodeAttribute::eNurbsCurve |
391 | * - FbxNodeAttribute::eBoundary |
392 | * - FbxNodeAttribute::eTrimNurbsSurface |
393 | * - FbxNodeAttribute::eSubDiv |
394 | * - FbxNodeAttribute::eLine |
395 | */ |
396 | FbxGeometry* GetGeometry(); |
397 | |
398 | /** Get the node attribute casted to a FbxMesh pointer. |
399 | * \return Pointer to the mesh object. |
400 | * \remarks This method will try to process the default node attribute first. If it cannot |
401 | * find it, it will scan the list of connected node attributes and get the first |
402 | * object that is a FbxNodeAttribute::eMesh. |
403 | * \remarks If the above search failed to get a valid pointer or it cannot |
404 | * be successfully casted, this method will return \c NULL. |
405 | */ |
406 | FbxMesh* GetMesh(); |
407 | |
408 | /** Get the node attribute casted to a FbxNurbs pointer. |
409 | * \return Pointer to the nurb object. |
410 | * \remarks This method will try to process the default node attribute first. If it cannot |
411 | * find it, it will scan the list of connected node attributes and get the first |
412 | * object that is a FbxNodeAttribute::eNurbs. |
413 | * \remarks If the above search failed to get a valid pointer or it cannot |
414 | * be successfully casted, this method will return \c NULL. |
415 | */ |
416 | FbxNurbs* GetNurbs(); |
417 | |
418 | /** Get the node attribute casted to a FbxNurbsSurface pointer. |
419 | * \return Pointer to the nurbs surface object. |
420 | * \remarks This method will try to process the default node attribute first. If it cannot |
421 | * find it, it will scan the list of connected node attributes and get the first |
422 | * object that is a FbxNodeAttribute::eNurbsSurface. |
423 | * \remarks If the above search failed to get a valid pointer or it cannot |
424 | * be successfully casted, this method will return \c NULL. |
425 | */ |
426 | FbxNurbsSurface* GetNurbsSurface(); |
427 | |
428 | /** Get the node attribute casted to a FbxNurbsCurve pointer. |
429 | * \return Pointer to the nurbs curve object. |
430 | * \remarks This method will try to process the default node attribute first. If it cannot |
431 | * find it, it will scan the list of connected node attributes and get the first |
432 | * object that is a FbxNodeAttribute::eNurbsCurve. |
433 | * \remarks If the above search failed to get a valid pointer or it cannot |
434 | * be successfully casted, this method will return \c NULL. |
435 | */ |
436 | FbxNurbsCurve* GetNurbsCurve(); |
437 | |
438 | /** Get the node attribute casted to a FbxLine pointer. |
439 | * \return Pointer to the line object. |
440 | * \remarks This method will try to process the default node attribute first. If it cannot |
441 | * find it, it will scan the list of connected node attributes and get the first |
442 | * object that is a FbxNodeAttribute::eLine. |
443 | * \remarks If the above search failed to get a valid pointer or it cannot |
444 | * be successfully casted, this method will return \c NULL. |
445 | */ |
446 | FbxLine* GetLine(); |
447 | |
448 | /** Get the node attribute casted to a FbxTrimNurbsSurface pointer. |
449 | * \return Pointer to the trim nurbs surface object. |
450 | * \remarks This method will try to process the default node attribute first. If it cannot |
451 | * find it, it will scan the list of connected node attributes and get the first |
452 | * object that is a FbxNodeAttribute::eTrimNurbsSurface. |
453 | * \remarks If the above search failed to get a valid pointer or it cannot |
454 | * be successfully casted, this method will return \c NULL. |
455 | */ |
456 | FbxTrimNurbsSurface* GetTrimNurbsSurface(); |
457 | |
458 | /** Get the node attribute casted to a FbxSubDiv pointer. |
459 | * \return Pointer to the subdivision surface object. |
460 | * \remarks This method will try to process the default node attribute first. If it cannot |
461 | * find it, it will scan the list of connected node attributes and get the first |
462 | * object that is a FbxNodeAttribute::eSubDiv. |
463 | * \remarks If the above search failed to get a valid pointer or it cannot |
464 | * be successfully casted, this method will return \c NULL. |
465 | */ |
466 | FbxSubDiv* GetSubdiv(); |
467 | |
468 | /** Get the node attribute casted to a FbxPatch pointer. |
469 | * \return Pointer to the patch object. |
470 | * \remarks This method will try to process the default node attribute first. If it cannot |
471 | * find it, it will scan the list of connected node attributes and get the first |
472 | * object that is a FbxNodeAttribute::ePatch. |
473 | * \remarks If the above search failed to get a valid pointer or it cannot |
474 | * be successfully casted, this method will return \c NULL. |
475 | */ |
476 | FbxPatch* GetPatch(); |
477 | |
478 | /** Get the node attribute casted to a FbxCamera pointer. |
479 | * \return Pointer to the camera object. |
480 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
481 | * be successfully casted, this method will return \c NULL. |
482 | */ |
483 | FbxCamera* GetCamera(); |
484 | const FbxCamera* GetCamera() const; |
485 | |
486 | /** Get the node attribute casted to a FbxCameraStereo pointer. |
487 | * \return Pointer to the stereo camera object. |
488 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
489 | * be successfully casted, this method will return \c NULL. |
490 | */ |
491 | FbxCameraStereo* GetCameraStereo(); |
492 | |
493 | /** Get the node attribute casted to a FbxCameraSwitcher pointer. |
494 | * \return Pointer to the camera switcher object. |
495 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
496 | * be successfully casted, this method will return \c NULL. |
497 | */ |
498 | FbxCameraSwitcher* GetCameraSwitcher(); |
499 | |
500 | /** Get the node attribute casted to a FbxLight pointer. |
501 | * \return Pointer to the light object. |
502 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
503 | * be successfully casted, this method will return \c NULL. |
504 | */ |
505 | FbxLight* GetLight(); |
506 | const FbxLight* GetLight() const; |
507 | |
508 | /** Get the node attribute casted to a FbxOpticalReference pointer. |
509 | * \return Pointer to the optical reference object. |
510 | * \remarks If the type cast failed because there is not default node attribute set or it cannot |
511 | * be successfully casted, this method will return \c NULL. |
512 | */ |
513 | FbxOpticalReference* GetOpticalReference(); |
514 | //@} |
515 | |
516 | /** |
517 | * \name Transformation propagation |
518 | * This set of functions provides direct access to the transformation propagations settings |
519 | * of the FbxNode. These settings determine how transformations must be applied when |
520 | * evaluating a node's transformation matrix. The possible values are: |
521 | * - eInheritRrSs : Scaling of parent is applied in the child world after the local child rotation. |
522 | * - eInheritRSrs : Scaling of parent is applied in the parent world. |
523 | * - eInheritRrs : Scaling of parent does not affect the scaling of children. |
524 | */ |
525 | //@{ |
526 | /** Sets how child transforms are inherited from parent transforms. |
527 | * \param pInheritType One of the following values eInheritRrSs, eInheritRSrs or eInheritRrs |
528 | */ |
529 | void SetTransformationInheritType(FbxTransform::EInheritType pInheritType); |
530 | |
531 | //! Get transformation inherit type. |
532 | void GetTransformationInheritType(FbxTransform::EInheritType& pInheritType) const; |
533 | //@} |
534 | |
535 | /** |
536 | * \name Pivot Management |
537 | * Pivots are used to specify translation, rotation and scaling centers in coordinates |
538 | * relative to a node's origin. |
539 | * A node has two pivot contexts defined by the EPivotSet enumeration. The node's animation |
540 | * data can be converted from one pivot context to the other. Each context can be set to be |
541 | * either active or passive (reference). By default the two pivot contexts are passive. They |
542 | * need to be active to be processed during the evaluation of the node final transformation |
543 | * matrix. In its passive state, a pivot context can still be accessed to retrieve its content |
544 | * for any other required purpose. Each pivot context stores values (as FbxVector4) for: |
545 | * \code |
546 | * - Rotation offset (Roff) |
547 | * - Rotation pivot (Rp) |
548 | * - Pre-rotation (Rpre) |
549 | * - Post-rotation (Rpost) |
550 | * - Scaling offset (Soff) |
551 | * - Scaling pivot (Sp) |
552 | * - Geometric translation (Gt) |
553 | * - Geometric rotation (Gr) |
554 | * - Geometric scaling (Gs) |
555 | * |
556 | * These values combine in the matrix form to compute the World transform of the node |
557 | * using the formula: |
558 | * |
559 | * World = ParentWorld * T * Roff * Rp * Rpre * R * Rpost * Rp-1 * Soff * Sp * S * Sp-1 |
560 | * \endcode |
561 | * |
562 | * The geometric transformation (Gt * Gr * Gs) is applied only to the node attribute and after |
563 | * the node transformations. This transformation is not inherited across the node hierarchy. |
564 | * |
565 | * \note Please refer to the FBX SDK programmers guide for more details. |
566 | * |
567 | * The application of the pivots is performed by calling the method ConvertPivotAnimation(). Typically, |
568 | * you set-up the eDestinationPivot context to match what your system can directly support and leave at (0,0,0) the |
569 | * attributes that are not supported by your system. When the values of a specific attribute in the |
570 | * two contexts (source and destination) are identical, the system considers that no adjustment is |
571 | * required because the attribute is directly supported in the destination world. |
572 | * |
573 | * Below is an example of code that shows how the pivot information could be setup before calling ConvertPivotAnimation(). |
574 | * \code |
575 | * FbxVector4 lZero(0,0,0); |
576 | * FbxVector4 lOne(1,1,1); |
577 | * pNode->SetPivotState(FbxNode::eSourcePivot, FbxNode::ePivotActive); |
578 | * pNode->SetPivotState(FbxNode::eDestinationPivot, FbxNode::ePivotActive); |
579 | * |
580 | * EFbxRotationOrder lRotationOrder; |
581 | * pNode->GetRotationOrder(FbxNode::eSourcePivot , lRotationOrder); |
582 | * pNode->SetRotationOrder(FbxNode::eDestinationPivot , lRotationOrder); |
583 | * |
584 | * //For cameras and lights (without targets) let's compensate the postrotation. |
585 | * if( pNode->GetCamera() || pNode->GetLight() ) |
586 | * { |
587 | * if( !pNode->GetTarget() ) |
588 | * { |
589 | * FbxVector4 lRV(90, 0, 0); |
590 | * if( pNode->GetCamera() ) |
591 | * lRV.Set(0, 90, 0); |
592 | * |
593 | * FbxVector4 prV = pNode->GetPostRotation(FbxNode::eSourcePivot); |
594 | * FbxAMatrix lSourceR; |
595 | * FbxAMatrix lR(lZero, lRV, lOne); |
596 | * FbxVector4 res = prV; |
597 | * |
598 | * // Rotation order don't affect post rotation, so just use the default XYZ order |
599 | * FbxRotationOrder rOrder; |
600 | * rOrder.V2M(lSourceR, res); |
601 | * |
602 | * lR = lSourceR * lR; |
603 | * rOrder.M2V(res, lR); |
604 | * prV = res; |
605 | * pNode->SetPostRotation(FbxNode::eSourcePivot, prV); |
606 | * pNode->SetRotationActive(true); |
607 | * } |
608 | * |
609 | * // Point light do not need to be adjusted (since they radiate in all the directions). |
610 | * if( pNode->GetLight() && pNode->GetLight()->LightType.Get() == FbxLight::ePoint ) |
611 | * { |
612 | * pNode->SetPostRotation(FbxNode::eSourcePivot, FbxVector4(0,0,0,0)); |
613 | * } |
614 | * } |
615 | * // apply Pre rotations only on bones / end of chains |
616 | * if( pNode->GetNodeAttribute() && pNode->GetNodeAttribute()->GetAttributeType() == FbxNodeAttribute::eSkeleton |
617 | * || (pNode->GetMarker() && pNode->GetMarker()->GetType() == FbxMarker::eEffectorFK) |
618 | * || (pNode->GetMarker() && pNode->GetMarker()->GetType() == FbxMarker::eEffectorIK) ) |
619 | * { |
620 | * if( pNode->GetRotationActive() ) |
621 | * { |
622 | * pNode->SetPreRotation(FbxNode::eDestinationPivot, pNode->GetPreRotation(FbxNode::eSourcePivot)); |
623 | * } |
624 | * |
625 | * // No pivots on bones |
626 | * pNode->SetRotationPivot(FbxNode::eDestinationPivot, lZero); |
627 | * pNode->SetScalingPivot(FbxNode::eDestinationPivot, lZero); |
628 | * pNode->SetRotationOffset(FbxNode::eDestinationPivot,lZero); |
629 | * pNode->SetScalingOffset(FbxNode::eDestinationPivot, lZero); |
630 | * } |
631 | * else |
632 | * { |
633 | * // any other type: no pre-rotation support but... |
634 | * pNode->SetPreRotation(FbxNode::eDestinationPivot, lZero); |
635 | * |
636 | * // support for rotation and scaling pivots. |
637 | * pNode->SetRotationPivot(FbxNode::eDestinationPivot, pNode->GetRotationPivot(FbxNode::eSourcePivot)); |
638 | * pNode->SetScalingPivot(FbxNode::eDestinationPivot, pNode->GetScalingPivot(FbxNode::eSourcePivot)); |
639 | * // Rotation and scaling offset are supported |
640 | * pNode->SetRotationOffset(FbxNode::eDestinationPivot, pNode->GetRotationOffset(FbxNode::eSourcePivot)); |
641 | * pNode->SetScalingOffset(FbxNode::eDestinationPivot, pNode->GetScalingOffset(FbxNode::eSourcePivot)); |
642 | * // |
643 | * // If we don't "support" scaling pivots, we can simply do: |
644 | * // pNode->SetRotationPivot(FbxNode::eDestinationPivot, lZero); |
645 | * // pNode->SetScalingPivot(FbxNode::eDestinationPivot, lZero); |
646 | * } |
647 | * \endcode |
648 | * |
649 | */ |
650 | //@{ |
651 | /** \enum EPivotSet Pivot context identifier. |
652 | */ |
653 | enum EPivotSet |
654 | { |
655 | eSourcePivot, //!< The source pivot context. |
656 | eDestinationPivot //!< The destination pivot context. |
657 | }; |
658 | |
659 | /** \enum EPivotState Pivot context state. |
660 | */ |
661 | enum EPivotState |
662 | { |
663 | ePivotActive, //!< The pivot context with this state is affecting the node's transform computation. |
664 | ePivotReference //!< The pivot context with this state is not used during the node transform computation but can be accessed for reference purposes. |
665 | }; |
666 | |
667 | /** Change the state of the pivot context. |
668 | * \param pPivotSet Specify which pivot context is manipulated. |
669 | * \param pPivotState The new state of the pivot context. |
670 | */ |
671 | void SetPivotState(EPivotSet pPivotSet, EPivotState pPivotState); |
672 | |
673 | /** Get the pivot context state. |
674 | * The returned value tells if this pivot context is used in the |
675 | * evaluation of the node transform or not. |
676 | * \param pPivotSet Specify which pivot context is queried. |
677 | * \param pPivotState The current state of the pivot set. |
678 | */ |
679 | void GetPivotState(EPivotSet pPivotSet, EPivotState& pPivotState) const; |
680 | |
681 | /** Set rotation space |
682 | * Determine the rotation space (Euler or Spheric) and the rotation order. |
683 | * \param pPivotSet Specify which pivot context is manipulated. |
684 | * \param pRotationOrder The new value for the pivot rotation order. |
685 | */ |
686 | void SetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder pRotationOrder); |
687 | |
688 | /** Get rotation order |
689 | * \param pPivotSet Specify which pivot context is queried. |
690 | * \param pRotationOrder The current value of the pivot rotation order. |
691 | */ |
692 | void GetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder& pRotationOrder) const; |
693 | |
694 | /** Set rotation space for limit only. |
695 | * \param pPivotSet Specify which pivot context is manipulated. |
696 | * \param pUseForLimitOnly When set to \c true, the current rotation space |
697 | * (set with SetRotationOrder) define the rotation space for |
698 | * the limit only; leaving the rotation animation in |
699 | * Euler XYZ space. When set to \c false, the current rotation |
700 | * space defines the rotation space for both the limits and the |
701 | * rotation animation data. |
702 | */ |
703 | void SetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet, bool pUseForLimitOnly); |
704 | |
705 | /** Get rotation space for limit only. |
706 | * \param pPivotSet Specify which pivot context is queried. |
707 | * \return The current rotation space limit flag value. |
708 | */ |
709 | bool GetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet) const; |
710 | |
711 | /** Set the RotationActive state. |
712 | * \param pVal The new state of the property. |
713 | * \remarks When this flag is set to false, the RotationOrder, the Pre/Post rotation values |
714 | * and the rotation limits should be ignored. |
715 | */ |
716 | void SetRotationActive(bool pVal); |
717 | |
718 | /** Get the RotationActive state. |
719 | * \return The value of the RotationActive flag. |
720 | */ |
721 | bool GetRotationActive() const; |
722 | |
723 | /** Specify which Quaternion interpolation mode is used on the pivot context. |
724 | * \param pPivotSet Specify which pivot context is manipulated. |
725 | * \param pQuatIterp The new value. |
726 | * \remarks When the \e pPivotSet is eSourcePivot, this method also updates the value of the |
727 | * QuaternionInterpolate property. |
728 | */ |
729 | void SetQuaternionInterpolation(EPivotSet pPivotSet, EFbxQuatInterpMode pQuatIterp); |
730 | |
731 | /** Get the Quaternion interpolation mode of the pivot context. |
732 | * \param pPivotSet Specify which pivot context is queried. |
733 | * \return The current mode set on the pivot context. |
734 | */ |
735 | EFbxQuatInterpMode GetQuaternionInterpolation(EPivotSet pPivotSet) const; |
736 | |
737 | /** Set the rotation stiffness. |
738 | * The stiffness attribute is used by IK solvers to generate a resistance |
739 | * to a joint motion. The higher the stiffness the less it will rotate. |
740 | * Stiffness works in a relative sense: it determines the willingness of |
741 | * this joint to rotate with respect to the other joint in the IK chain. |
742 | * \param pRotationStiffness The rotation stiffness values are limited to |
743 | * the range [0, 100]. |
744 | */ |
745 | void SetRotationStiffness(FbxVector4 pRotationStiffness); |
746 | |
747 | /** Get the rotation stiffness |
748 | * \return The currently set rotation stiffness values. |
749 | */ |
750 | FbxVector4 GetRotationStiffness() const; |
751 | |
752 | /** Set the minimum damp range angles. |
753 | * This attributes apply resistance to a joint rotation as it approaches the |
754 | * lower boundary of its rotation limits. This functionality allows joint |
755 | * motion to slow down smoothly until the joint reaches its rotation limits |
756 | * instead of stopping abruptly. The MinDampRange specifies when the |
757 | * deceleration should start. |
758 | * \param pMinDampRange Angle, in degrees, where deceleration should start |
759 | */ |
760 | void SetMinDampRange(FbxVector4 pMinDampRange); |
761 | |
762 | /** Get the minimum damp range angles |
763 | * \return The currently set minimum damp range angles. |
764 | */ |
765 | FbxVector4 GetMinDampRange() const; |
766 | |
767 | /** Set the maximum damp range angles. |
768 | * This attributes apply resistance to a joint rotation as it approaches the |
769 | * upper boundary of its rotation limits. This functionality allows joint |
770 | * motion to slow down smoothly until the joint reaches its rotation limits |
771 | * instead of stopping abruptly. The MaxDampRange specifies when the |
772 | * deceleration should start. |
773 | * \param pMaxDampRange Angle, in degrees, where deceleration should start |
774 | */ |
775 | void SetMaxDampRange(FbxVector4 pMaxDampRange); |
776 | |
777 | /** Get the maximum damp range angles |
778 | * \return The currently set maximum damp range angles. |
779 | */ |
780 | FbxVector4 GetMaxDampRange() const; |
781 | |
782 | /** Set the minimum damp strength. |
783 | * This attributes apply resistance to a joint rotation as it approaches the |
784 | * lower boundary of its rotation limits. This functionality allows joint |
785 | * motion to slow down smoothly until the joint reaches its rotation limits |
786 | * instead of stopping abruptly. The MinDampStrength defines the |
787 | * rate of deceleration. |
788 | * \param pMinDampStrength Values are limited to the range [0, 100]. |
789 | */ |
790 | void SetMinDampStrength(FbxVector4 pMinDampStrength); |
791 | |
792 | /** Get the minimum damp strength |
793 | * \return The currently set minimum damp strength values. |
794 | */ |
795 | FbxVector4 GetMinDampStrength() const; |
796 | |
797 | /** Set the maximum damp strength. |
798 | * This attributes apply resistance to a joint rotation as it approaches the |
799 | * upper boundary of its rotation limits. This functionality allows joint |
800 | * motion to slow down smoothly until the joint reaches its rotation limits |
801 | * instead of stopping abruptly. The MaxDampStrength defines the |
802 | * rate of deceleration. |
803 | * \param pMaxDampStrength Values are limited to the range [0, 100]. |
804 | */ |
805 | void SetMaxDampStrength(FbxVector4 pMaxDampStrength); |
806 | |
807 | /** Get the maximum damp strength |
808 | * \return The currently set maximum damp strength values. |
809 | */ |
810 | FbxVector4 GetMaxDampStrength() const; |
811 | |
812 | /** Set the preferred angle. |
813 | * The preferredAngle attribute defines the initial joint configuration used |
814 | * by a single chain IK solver to calculate the inverse kinematic solution. |
815 | * \param pPreferedAngle Angle in degrees |
816 | */ |
817 | void SetPreferedAngle(FbxVector4 pPreferedAngle); |
818 | |
819 | /** Get the preferred angle |
820 | * \return The currently set preferred angle. |
821 | */ |
822 | FbxVector4 GetPreferedAngle() const; |
823 | |
824 | /** Set a translation offset for the rotation pivot. |
825 | * The translation offset is in coordinates relative to the node's origin. |
826 | * \param pPivotSet Specify which pivot set to modify. |
827 | * \param pVector The X,Y and Z translation values (the 4th component of the FbxVector4 is ignored). |
828 | */ |
829 | void SetRotationOffset(EPivotSet pPivotSet, FbxVector4 pVector); |
830 | |
831 | /** Get the translation offset for the rotation pivot. |
832 | * The translation offset is in coordinates relative to the node's origin. |
833 | * \param pPivotSet Specify which pivot set to to query the value. |
834 | * \return The X, Y and Z translation offset values (the 4th component of the FbxVector4 is always 1). |
835 | */ |
836 | const FbxVector4& GetRotationOffset(EPivotSet pPivotSet) const; |
837 | |
838 | /** Set rotation pivot. |
839 | * The rotation pivot is the center of rotation in coordinates relative to |
840 | * the node's origin. |
841 | * \param pPivotSet Specify which pivot set to modify. |
842 | * \param pVector The new position of the rotation pivot (the 4th component of the FbxVector4 is ignored). |
843 | */ |
844 | void SetRotationPivot(EPivotSet pPivotSet, FbxVector4 pVector); |
845 | |
846 | /** Get rotation pivot. |
847 | * The rotation pivot is the center of rotation in coordinates relative to |
848 | * the node's origin. |
849 | * \param pPivotSet Specify which pivot set to query. |
850 | * \return The current position of the rotation pivot (the 4th component of the FbxVector4 is always 1). |
851 | */ |
852 | const FbxVector4& GetRotationPivot(EPivotSet pPivotSet) const; |
853 | |
854 | /** Set pre-rotation in Euler angles. |
855 | * The pre-rotation is the rotation applied to the node before |
856 | * rotation animation data. |
857 | * \param pPivotSet Specify which pivot set to modify. |
858 | * \param pVector The X,Y,Z rotation values to set (the 4th component of the FbxVector4 is ignored). |
859 | */ |
860 | void SetPreRotation(EPivotSet pPivotSet, FbxVector4 pVector); |
861 | |
862 | /** Get pre-rotation in Euler angles. |
863 | * The pre-rotation is the rotation applied to the node before |
864 | * rotation animation data. |
865 | * \param pPivotSet Specify which pivot set to query. |
866 | * \return The X,Y and Z rotation values (the 4th component of the FbxVector4 is always 1). |
867 | */ |
868 | const FbxVector4& GetPreRotation(EPivotSet pPivotSet) const; |
869 | |
870 | /** Set post-rotation in Euler angles. |
871 | * The post-rotation is the rotation applied to the node after the |
872 | * rotation animation data. |
873 | * \param pPivotSet Specify which pivot set to modify. |
874 | * \param pVector The X,Y,Z rotation values to set (the 4th component of the FbxVector4 is ignored). |
875 | */ |
876 | void SetPostRotation(EPivotSet pPivotSet, FbxVector4 pVector); |
877 | |
878 | /** Get post-rotation in Euler angles. |
879 | * The post-rotation is the rotation applied to the node after the |
880 | * rotation animation data. |
881 | * \param pPivotSet Specify which pivot set to query. |
882 | * \return The X,Y and Z rotation values (the 4th component of the FbxVector4 is always 1). |
883 | */ |
884 | const FbxVector4& GetPostRotation(EPivotSet pPivotSet) const; |
885 | |
886 | /** Set a translation offset for the scaling pivot. |
887 | * The translation offset is in coordinates relative to the node's origin. |
888 | * \param pPivotSet Specify which pivot set to modify. |
889 | * \param pVector The X,Y and Z translation values (the 4th component of the FbxVector4 is ignored). |
890 | */ |
891 | void SetScalingOffset(EPivotSet pPivotSet, FbxVector4 pVector); |
892 | |
893 | /** Get the translation offset for the scaling pivot. |
894 | * The translation offset is in coordinates relative to the node's origin. |
895 | * \param pPivotSet Specify which pivot set to query the value. |
896 | * \return The X, Y and Z translation offset values (the 4th component of the FbxVector4 is always 1). |
897 | */ |
898 | const FbxVector4& GetScalingOffset(EPivotSet pPivotSet) const; |
899 | |
900 | /** Set scaling pivot. |
901 | * The scaling pivot is the center of scaling in coordinates relative to |
902 | * the node's origin. |
903 | * \param pPivotSet Specify which pivot set to modify. |
904 | * \param pVector The new position of the scaling pivot (the 4th component of the FbxVector4 is ignored). |
905 | */ |
906 | void SetScalingPivot(EPivotSet pPivotSet, FbxVector4 pVector); |
907 | |
908 | /** Get scaling pivot. |
909 | * The scaling pivot is the center of scaling in coordinates relative to |
910 | * the node's origin. |
911 | * \param pPivotSet Specify which pivot set to query. |
912 | * \return The current position of the rotation pivot (the 4th component of the FbxVector4 is always 1). |
913 | */ |
914 | const FbxVector4& GetScalingPivot(EPivotSet pPivotSet) const; |
915 | |
916 | /** Set geometric translation |
917 | * The geometric translation is a local translation that is applied |
918 | * to a node attribute only. This translation is applied to the node attribute |
919 | * after the node transformations. This translation is not inherited across the |
920 | * node hierarchy. |
921 | * \param pPivotSet Specify which pivot set to modify. |
922 | * \param pVector The X, Y, and Z translation values (the 4th component of the FbxVector4 is ignored). |
923 | */ |
924 | void SetGeometricTranslation(EPivotSet pPivotSet, FbxVector4 pVector); |
925 | |
926 | /** Get geometric translation |
927 | * \param pPivotSet Specify which pivot set to query. |
928 | * \return The current geometric translation (the 4th component of the FbxVector4 is always 1). |
929 | */ |
930 | FbxVector4 GetGeometricTranslation(EPivotSet pPivotSet) const; |
931 | |
932 | /** Set geometric rotation |
933 | * The geometric rotation is a local rotation that is applied |
934 | * to a node attribute only. This rotation is applied to the node attribute |
935 | * after the node transformations. This rotation is not inherited across the |
936 | * node hierarchy. |
937 | * \param pPivotSet Specify which pivot set to modify. |
938 | * \param pVector The X,Y and Z rotation values (the 4th component of the FbxVector4 is ignored). |
939 | */ |
940 | void SetGeometricRotation(EPivotSet pPivotSet, FbxVector4 pVector); |
941 | |
942 | /** Get geometric rotation |
943 | * \param pPivotSet Specify which pivot set to query. |
944 | * \return The current geometric rotation (the 4th component of the FbxVector4 is always 1). |
945 | */ |
946 | FbxVector4 GetGeometricRotation(EPivotSet pPivotSet) const; |
947 | |
948 | /** Set geometric scaling |
949 | * The geometric scaling is a local scaling that is applied |
950 | * to a node attribute only. This scaling is applied to the node attribute |
951 | * after the node transformations. This scaling is not inherited across the |
952 | * node hierarchy. |
953 | * \param pPivotSet Specify which pivot set to modify. |
954 | * \param pVector The X,Y and Z scale values (the 4th component of the FbxVector4 is ignored). |
955 | */ |
956 | void SetGeometricScaling(EPivotSet pPivotSet, FbxVector4 pVector); |
957 | |
958 | /** Get geometric scaling |
959 | * \param pPivotSet Specify which pivot set to query. |
960 | * \return The current geometric scaling (the 4th component of the FbxVector4 is always 1). |
961 | */ |
962 | FbxVector4 GetGeometricScaling(EPivotSet pPivotSet) const; |
963 | |
964 | /** Reset a pivot set to the default pivot context. |
965 | * If the node has a geometry, reset the geometry's pivot to the identity matrix. |
966 | * \param pPivotSet Pivot set to reset. |
967 | * \remarks The default pivot context is a context with all the vector attributes |
968 | * set to (0,0,0) except the GeometricScaling attribute that is reset to (1,1,1). |
969 | */ |
970 | void ResetPivotSet( FbxNode::EPivotSet pPivotSet ); |
971 | |
972 | /** This version is an improved version of the ConvertPivotAnimation(). It fully supports all the |
973 | * attributes defined in the pivot sets and can process animation data defined on different animation |
974 | * stack. |
975 | * \param pAnimStack The animation stack on which the conversion will take place. If equals \c NULL, convert the animation on all the animation stacks. |
976 | * \param pConversionTarget If set to EPivotSet::eDestinationPivot, |
977 | * convert animation data from the EPivotSet::eSourcePivot pivot context |
978 | * to the EPivotSet::eDestinationPivot pivot context. Otherwise, the |
979 | * conversion is computed the other way around. |
980 | * \param pFrameRate Resampling frame rate in frames per second. |
981 | * \param pKeyReduce Apply or skip key reducing filter. |
982 | * \remarks Due to the intrinsic properties of the mathematical operations performed, |
983 | * sometimes, it is necessary to resample animation curves to maintain the accurate |
984 | * conversion. When this resampling is required, the method will use the \e pFrameRate |
985 | * value to specify the number of samples. To avoid a huge number of keys in the animation |
986 | * curves, a constant key reducer filter (FbxKFCurveFilterConstantKeyReducer) is |
987 | * automatically applied to all the affected curves to remove as much consecutive keys |
988 | * that have the same value. This filter is private and its settings cannot be changed. |
989 | * It is possible that, after the filtering pass, the animations curves do not contain keys |
990 | * anymore. This is a normal result and does not affect the overall results. |
991 | * \note Although it is possible to call this method several times with a different |
992 | * AnimStack name, users must be aware that some pivot computation can irreversibly |
993 | * modify the geometric nodes with a cumulative effect of the \e GeometricTranslation, |
994 | * \e GeometricRotation and \e GeometricScaling which will produce undesirable results. It is recommended |
995 | * to call ConvertPivotAnimationRecursive with \p pAnimStackName = NULL and let the method convert |
996 | * the animation on all the Anim stacks at once. |
997 | * In the case when there are no geometric nodes in the scene tree, specifying the animation stack |
998 | * is safe and somewhat faster. |
999 | * If any transform limits are active, they are applied during the conversion and disabled. |
1000 | */ |
1001 | void ConvertPivotAnimationRecursive(FbxAnimStack* pAnimStack, EPivotSet pConversionTarget, double pFrameRate, bool pKeyReduce=true); |
1002 | |
1003 | /** Reset all the pivot sets to the default pivot context and convert the animation. |
1004 | * \param pFrameRate Resampling frame rate in frames per second. |
1005 | * \param pKeyReduce Apply or skip key reducing filter. |
1006 | * \param pToNodeCenter: Reset pivots to node center if \c true, or retain pivot places if \c false. |
1007 | * \param pForceResetLimits If \c true, this flag will reset all the Translation, Rotation and Scaling |
1008 | * limits and clears the enabled flags. |
1009 | * \remarks The resulting animation will be visually equivalent and all the pivots will be cleared. |
1010 | * The conversion is performed on all animation stacks. |
1011 | * \remarks Will recursively convert the animation of all the children nodes. |
1012 | * \remarks The \e pForceResetLimits flag has a destructive behavior and should be used only in very |
1013 | * limited cases where the values of the limits are not required after the call to this method. |
1014 | * \remarks Currently, this function just works under RSrs inherit type if pToNodeCenter is set to \c false. |
1015 | */ |
1016 | void ResetPivotSetAndConvertAnimation(double pFrameRate=30.0, bool pKeyReduce=false, bool pToNodeCenter=true, bool pForceResetLimits=false); |
1017 | |
1018 | /** Set rotation pivot as node center recursively |
1019 | * \param pParentGeometricOffset Offset vector to be applied. |
1020 | */ |
1021 | void SetRotationPivotAsCenterRecursive(FbxVector4 pParentGeometricOffset=FbxVector4()); |
1022 | //@} |
1023 | |
1024 | /** |
1025 | * \name Node Evaluation Functions |
1026 | */ |
1027 | //@{ |
1028 | /** Retrieve the proper animation evaluator to use for this node. |
1029 | * \return If the object has no scene, returns the default evaluator, otherwise the object's scene evaluator. */ |
1030 | FbxAnimEvaluator* GetAnimationEvaluator() const; |
1031 | |
1032 | /** Returns this node's global transformation matrix at the specified time. The node's translation, rotation and scaling limits are taken into consideration. |
1033 | * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation. |
1034 | * \param pPivotSet The pivot set to take into account |
1035 | * \param pApplyTarget Applies the necessary transform to align into the target node |
1036 | * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date. |
1037 | * \return The resulting global transform of the specified node at the specified time. |
1038 | * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeGlobalTransform(). |
1039 | */ |
1040 | FbxAMatrix& EvaluateGlobalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false); |
1041 | |
1042 | /** Returns this node's local transformation matrix at the specified time. The node's translation, rotation and scaling limits are taken into consideration. |
1043 | * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation. |
1044 | * \param pPivotSet The pivot set to take into account |
1045 | * \param pApplyTarget Applies the necessary transform to align into the target node |
1046 | * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date. |
1047 | * \return The resulting local transform of the specified node for the specified time. |
1048 | * \remarks The local transform matrix is calculated in this way: ParentGlobal.Inverse * Global, all transforms such as pre/post rotation are taken into consideration. |
1049 | * This will return a different value than LclTranslation, LclRotation and LclScaling at the specified time. To evaluate these properties separately |
1050 | * without taking pre/post rotation, pivots and offsets into consideration, please use GetNodeLocalTranslation(), GetNodeLocalRotation() and GetNodeLocalScaling(). |
1051 | * This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalTransform(). |
1052 | */ |
1053 | FbxAMatrix& EvaluateLocalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false); |
1054 | |
1055 | /** Returns this node's LclTranslation property at the specified time. |
1056 | * No pivot, offsets, or any other transform is taken into consideration. The translation limit is applied. |
1057 | * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation. |
1058 | * \param pPivotSet The pivot set to take into account |
1059 | * \param pApplyTarget Applies the necessary transform to align into the target node |
1060 | * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date. |
1061 | * \return The resulting value of LclTranslation property of the specified node at the specified time. |
1062 | * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalTranslation(). |
1063 | */ |
1064 | FbxVector4& EvaluateLocalTranslation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false); |
1065 | |
1066 | /** Returns this node's LclRotation property at the specified time. |
1067 | * No pre/post rotation, rotation pivot, rotation offset or any other transform is taken into consideration. The rotation limit is applied. |
1068 | * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation. |
1069 | * \param pPivotSet The pivot set to take into account |
1070 | * \param pApplyTarget Applies the necessary transform to align into the target node |
1071 | * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date. |
1072 | * \return The resulting value of LclRotation property of the specified node at the specified time. |
1073 | * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalRotation(). |
1074 | */ |
1075 | FbxVector4& EvaluateLocalRotation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false); |
1076 | |
1077 | /** Returns this node's LclScaling property at the specified time. |
1078 | * No scaling pivot, scaling offset or any other transform is taken into consideration. The scaling limit is applied. |
1079 | * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation. |
1080 | * \param pPivotSet The pivot set to take into account |
1081 | * \param pApplyTarget Applies the necessary transform to align into the target node |
1082 | * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date. |
1083 | * \return The resulting value of LclScaling property of the specified node at the specified time. |
1084 | * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalScaling(). |
1085 | */ |
1086 | FbxVector4& EvaluateLocalScaling(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false); |
1087 | |
1088 | /** Compute the node's bounding box and its center in global coordinates. |
1089 | * \param pBBoxMin The minimum value of the bounding box upon successful return. |
1090 | * \param pBBoxMax The maximum value of the bounding box upon successful return. |
1091 | * \param pBBoxCenter The center value of the bounding box upon successful return. |
1092 | * \param pTime If different from FBXSDK_TIME_INFINITE, time used to compute the bounding box for deformed geometry. |
1093 | * \return \c true if successful, otherwise \c false. |
1094 | * \remark If geometry have been unloaded from memory, their bounding box cannot be calculated and will use any value set previously. */ |
1095 | bool EvaluateGlobalBoundingBoxMinMaxCenter(FbxVector4& pBBoxMin, FbxVector4& pBBoxMax, FbxVector4& pBBoxCenter, const FbxTime& pTime=FBXSDK_TIME_INFINITE); |
1096 | |
1097 | /** Compute closest ray intersection point with mesh attributes of this node (triangle meshes only!). |
1098 | * \param pOut The closest intersection point from pRayOrigin location in pRayDir direction. Variable is unchanged if return value is \c false. |
1099 | * \param pRayOrigin The origin location to cast the ray from. |
1100 | * \param pRayDir The direction the cast ray to test mesh triangles from. |
1101 | * \param pCulling If \c true, only test triangles that are front facing, otherwise test both sides. |
1102 | * \param pTime The time to use to evaluate mesh deformations. |
1103 | * \return \c true if a triangle intersect with the ray, otherwise \c false. |
1104 | * \remark This function will automatically fail if the node's meshes are not triangulated. */ |
1105 | bool EvaluateRayIntersectionPoint(FbxVector4& pOut, const FbxVector4& pRayOrigin, const FbxVector4& pRayDir, bool pCulling=false, const FbxTime& pTime=FBXSDK_TIME_INFINITE); |
1106 | //@} |
1107 | |
1108 | /** |
1109 | * \name Character Link |
1110 | */ |
1111 | //@{ |
1112 | /** Get number of character links. |
1113 | * \return The number of character links. |
1114 | */ |
1115 | int GetCharacterLinkCount() const; |
1116 | |
1117 | /** Get character link at given index. |
1118 | * \param pIndex Index of character link. |
1119 | * \param pCharacter Pointer to receive linked character if function succeeds. |
1120 | * \param pCharacterLinkType Pointer to receive character link type if function succeeds, |
1121 | * cast to \c FbxCharacterLink::Type. |
1122 | * \param pNodeId Pointer to receive the node ID if function succeeds. This ID should be casted |
1123 | * to \c FbxCharacter::ENodeId type when the character link type is \c eCharacterLink or |
1124 | * \c eControlSetLink else to the \c FbxEffector::ENodeId type if the character link type is |
1125 | * \c eControlSetEffector or \c eControlSetEffectorAux. |
1126 | * \param pNodeSubId For internal use. |
1127 | * \return \c false if the index is out of range or any of the pointer arguments is NULL. |
1128 | */ |
1129 | bool GetCharacterLink(int pIndex, FbxCharacter** pCharacter, int* pCharacterLinkType, int* pNodeId, int* pNodeSubId); |
1130 | |
1131 | /** Looks if the given character link exists on this node. |
1132 | * \param pCharacter Character searched. |
1133 | * \param pCharacterLinkType Character link type searched. Its value must be one of |
1134 | * the \c FbxCharacterLink::Type symbols.. |
1135 | * \param pNodeId Node ID searched. If \e pCharacterLinkType is \c eCharacterLink or \c eControlSetLink |
1136 | * the \e pNodeId value is casted to the \c FbxCharacter::ENodeId type. If the \e pCharacterLinkType |
1137 | * is \c eControlSetEffector or \c eControlSetEffectorAux then the \e pNodeId is casted to the |
1138 | * \c FbxEffector::ENodeId type. |
1139 | * \param pNodeSubId For internal use. |
1140 | * \return Index of found character link if it exists, -1 otherwise. |
1141 | */ |
1142 | int FindCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId) const; |
1143 | //@} |
1144 | |
1145 | /** Find out start and end time of the animation curves for this node (and its children). |
1146 | * \param pInterval This node's animation interval. |
1147 | * \param pAnimStack Animation stack where to retrieve animation curves. |
1148 | * \param pAnimLayerId Specific animation layer on the animStack to use. |
1149 | * \return \c true if the node (or its children) is animated, \c false otherwise. |
1150 | * \remarks If pAnimStack is left NULL, the function will try to get the first AnimStack that is connected |
1151 | * to the scene. \e pAnimLayerId represent the index of the connection. For example, the call: |
1152 | * \code |
1153 | * lNode->GetAnimationInterval(span, myStack, 3); |
1154 | * \endcode |
1155 | * will scan all the animation curves of this node, and it's children, that are defined on the third |
1156 | * animation layer of \c myStack. |
1157 | */ |
1158 | bool GetAnimationInterval(FbxTimeSpan& pInterval, FbxAnimStack* pAnimStack=NULL, int pAnimLayerId=0); |
1159 | |
1160 | /** |
1161 | * \name Material Management |
1162 | */ |
1163 | //@{ |
1164 | /** Add a material to this node. |
1165 | * \param pMaterial The material to add. |
1166 | * \return non-negative index of added material, or -1 on error. |
1167 | */ |
1168 | int AddMaterial(FbxSurfaceMaterial* pMaterial); |
1169 | |
1170 | /** Remove a material from this node. |
1171 | * \param pMaterial The material to remove. |
1172 | * \return true on success, false otherwise |
1173 | */ |
1174 | bool RemoveMaterial(FbxSurfaceMaterial* pMaterial); |
1175 | |
1176 | /** |
1177 | * \return The number of materials applied to this node. |
1178 | * \remarks If this node has an instanced node attribute, it is possible |
1179 | * to have a material applied to this node more than once. The material |
1180 | * count may not reflect the distinct material count. |
1181 | */ |
1182 | int GetMaterialCount() const; |
1183 | |
1184 | /** Access a material on this node. |
1185 | * \param pIndex Valid range is [0, GetMaterialCount() - 1] |
1186 | * \return The pIndex-th material, or NULL if pIndex is invalid. |
1187 | */ |
1188 | FbxSurfaceMaterial* GetMaterial(int pIndex) const; |
1189 | |
1190 | /** Remove all materials applied to this node. |
1191 | */ |
1192 | void RemoveAllMaterials(); |
1193 | |
1194 | /** Find an applied material with the given name. |
1195 | * \param pName The requested name |
1196 | * \return an index to a material, or -1 if no applied material |
1197 | * has the requested name. |
1198 | */ |
1199 | int GetMaterialIndex(const char* pName) const; |
1200 | //@} |
1201 | |
1202 | /** |
1203 | * \name Public and fast access Properties |
1204 | */ |
1205 | //@{ |
1206 | /** This property contains the translation information of the node |
1207 | * |
1208 | * To access this property do: LclTranslation.Get(). |
1209 | * To set this property do: LclTranslation.Set(FbxDouble3). |
1210 | * |
1211 | * Default value is 0.,0.,0. |
1212 | */ |
1213 | FbxPropertyT<FbxDouble3> LclTranslation; |
1214 | |
1215 | /** This property contains the rotation information of the node |
1216 | * |
1217 | * To access this property do: LclRotation.Get(). |
1218 | * To set this property do: LclRotation.Set(FbxDouble3). |
1219 | * |
1220 | * Default value is 0.,0.,0. |
1221 | */ |
1222 | FbxPropertyT<FbxDouble3> LclRotation; |
1223 | |
1224 | /** This property contains the scaling information of the node |
1225 | * |
1226 | * To access this property do: LclScaling.Get(). |
1227 | * To set this property do: LclScaling.Set(FbxDouble3). |
1228 | * |
1229 | * Default value is 1.,1.,1. |
1230 | */ |
1231 | FbxPropertyT<FbxDouble3> LclScaling; |
1232 | |
1233 | /** This property contains the visibility information of the node. |
1234 | * The assumed behavior of this property is to affect the visibility of the node, all the |
1235 | * nodes attributes connected to it as well as all its descendants. This property can be |
1236 | * animated. |
1237 | * |
1238 | * To access this property do: Visibility.Get(). |
1239 | * To set this property do: Visibility.Set(FbxDouble). |
1240 | * |
1241 | * Default value is 1. |
1242 | * \remarks \li This property holds values ranging from 0.0 to 1.0 where the value 0.0 means |
1243 | * a totally invisible object, the value 1.0, a full visible object and anything inbetween, a |
1244 | * percentage degree of visibility.\n |
1245 | * |
1246 | * \li Since not all the applications may support a degree of visibility, it is agreed that |
1247 | * a value of 0.0 means invisible and anything else means visible. |
1248 | * |
1249 | * \see Show property. |
1250 | */ |
1251 | FbxPropertyT<FbxDouble> Visibility; |
1252 | |
1253 | /** This property contains the visibility inheritance flag that allow applications to modify |
1254 | * the Visibility property interpretation. By default, this value is set to \c true because it is |
1255 | * assumed (as explained in the Visibility property description) that the node visibility is inherited |
1256 | * from its parent. In other words, applications should always process the Visibility property of the |
1257 | * node and, depending on its value, decide whether or not the node has to be displayed. After |
1258 | * this first assessment, check the node VisibilityInheritance flag. If its value is set to \c false then |
1259 | * move to the next object, else use the parent's Visibility value and modify this node display state |
1260 | * by performing the logical AND operation between this node Visibility property and its parent's. |
1261 | * |
1262 | * To access this property do: VisibilityInheritance.Get(). |
1263 | * To set this property do: VisibilityInheritance.Set(FbxBool). |
1264 | * |
1265 | * Default value is \c true. |
1266 | * \remarks This property is non-animatable and is not used inside the FBX SDK but it is guaranteed |
1267 | * to exist in FBX files with version 7.2 and above. |
1268 | * \see Visibility property. |
1269 | */ |
1270 | FbxPropertyT<FbxBool> VisibilityInheritance; |
1271 | |
1272 | |
1273 | /** This property contains the quaternion interpolate flag of the node |
1274 | * |
1275 | * To access this property do: QuaternionInterpolate.Get(). |
1276 | * To set this property do: QuaternionInterpolate.Set(EFbxQuatInterpMode). |
1277 | * |
1278 | * Default value is eQuatInterpOff. |
1279 | */ |
1280 | FbxPropertyT<EFbxQuatInterpMode> QuaternionInterpolate; |
1281 | |
1282 | /** This property contains the rotation offset information of the node |
1283 | * |
1284 | * To access this property do: RotationOffset.Get(). |
1285 | * To set this property do: RotationOffset.Set(FbxDouble3). |
1286 | * |
1287 | * Default value is 0.,0.,0. |
1288 | */ |
1289 | FbxPropertyT<FbxDouble3> RotationOffset; |
1290 | |
1291 | /** This property contains the rotation pivot information of the node |
1292 | * |
1293 | * To access this property do: RotationPivot.Get(). |
1294 | * To set this property do: RotationPivot.Set(FbxDouble3). |
1295 | * |
1296 | * Default value is 0.,0.,0. |
1297 | */ |
1298 | FbxPropertyT<FbxDouble3> RotationPivot; |
1299 | |
1300 | /** This property contains the scaling offset information of the node |
1301 | * |
1302 | * To access this property do: ScalingOffset.Get(). |
1303 | * To set this property do: ScalingOffset.Set(FbxDouble3). |
1304 | * |
1305 | * Default value is 0.,0.,0. |
1306 | */ |
1307 | FbxPropertyT<FbxDouble3> ScalingOffset; |
1308 | |
1309 | /** This property contains the scaling pivot information of the node |
1310 | * |
1311 | * To access this property do: ScalingPivot.Get(). |
1312 | * To set this property do: ScalingPivot.Set(FbxDouble3). |
1313 | * |
1314 | * Default value is 0.,0.,0. |
1315 | */ |
1316 | FbxPropertyT<FbxDouble3> ScalingPivot; |
1317 | |
1318 | /** This property enables or disables the limit on translation. |
1319 | * When set to \c false the object can translate in any direction without limitations. |
1320 | * Else the |
1321 | * \ref TranslationMinX, \ref TranslationMinY, \ref TranslationMinZ, |
1322 | * \ref TranslationMaxX, \ref TranslationMaxY and \ref TranslationMaxZ flags are used to |
1323 | * limit the translation on each individual axis. |
1324 | * |
1325 | * To access this property do: TranslationActive.Get(). |
1326 | * To set this property do: TranslationActive.Set(FbxBool). |
1327 | * |
1328 | * Default value is false. |
1329 | */ |
1330 | FbxPropertyT<FbxBool> TranslationActive; |
1331 | |
1332 | /** This property sets the minimum translation values the object can occupy on each individual axis. |
1333 | * |
1334 | * To access this property do: TranslationMin.Get(). |
1335 | * To set this property do: TranslationMin.Set(FbxDouble3). |
1336 | * Default value is 0.,0.,0. |
1337 | * |
1338 | */ |
1339 | FbxPropertyT<FbxDouble3> TranslationMin; |
1340 | |
1341 | /** This property sets the maximum translation values the object can occupy on each individual axis. |
1342 | * |
1343 | * To access this property do: TranslationMax.Get(). |
1344 | * To set this property do: TranslationMax.Set(FbxDouble3). |
1345 | * Default value is 0.,0.,0. |
1346 | * |
1347 | */ |
1348 | FbxPropertyT<FbxDouble3> TranslationMax; |
1349 | |
1350 | /** This property enables or disables the limit on translation X. |
1351 | * When set to \c true, the object translation is constrained by the value of \ref TranslationMin. |
1352 | * |
1353 | * To access this property do: TranslationMinX.Get(). |
1354 | * To set this property do: TranslationMinX.Set(FbxBool). |
1355 | * |
1356 | * Default value is false. |
1357 | */ |
1358 | FbxPropertyT<FbxBool> TranslationMinX; |
1359 | |
1360 | /** This property enables or disables the limit on translation Y. |
1361 | * When set to \c true, the object translation is constrained by the value of \ref TranslationMin. |
1362 | * |
1363 | * To access this property do: TranslationMinY.Get(). |
1364 | * To set this property do: TranslationMinY.Set(FbxBool). |
1365 | * |
1366 | * Default value is false. |
1367 | */ |
1368 | FbxPropertyT<FbxBool> TranslationMinY; |
1369 | |
1370 | |
1371 | /** This property enables or disables the limit on translation Z. |
1372 | * When set to \c true, the object translation is constrained by the value of \ref TranslationMin. |
1373 | * |
1374 | * To access this property do: TranslationMinZ.Get(). |
1375 | * To set this property do: TranslationMinZ.Set(FbxBool). |
1376 | * |
1377 | * Default value is false. |
1378 | */ |
1379 | FbxPropertyT<FbxBool> TranslationMinZ; |
1380 | |
1381 | /** This property enables or disables the limit on translation X. |
1382 | * When set to \c true, the object translation is constrained by the value of \ref TranslationMax. |
1383 | * |
1384 | * To access this property do: TranslationMaxX.Get(). |
1385 | * To set this property do: TranslationMaxX.Set(FbxBool). |
1386 | * |
1387 | * Default value is false. |
1388 | */ |
1389 | FbxPropertyT<FbxBool> TranslationMaxX; |
1390 | |
1391 | /** This property enables or disables the limit on translation Y. |
1392 | * When set to \c true, the object translation is constrained by the value of \ref TranslationMax. |
1393 | * |
1394 | * To access this property do: TranslationMaxY.Get(). |
1395 | * To set this property do: TranslationMaxY.Set(FbxBool). |
1396 | * |
1397 | * Default value is false. |
1398 | */ |
1399 | FbxPropertyT<FbxBool> TranslationMaxY; |
1400 | |
1401 | /** This property enables or disables the limit on translation Z. |
1402 | * When set to \c true, the object translation is constrained by the value of \ref TranslationMax. |
1403 | * |
1404 | * To access this property do: TranslationMaxZ.Get(). |
1405 | * To set this property do: TranslationMaxZ.Set(FbxBool). |
1406 | * |
1407 | * Default value is false. |
1408 | */ |
1409 | FbxPropertyT<FbxBool> TranslationMaxZ; |
1410 | |
1411 | /** This property contains the rotation order information of the node |
1412 | * |
1413 | * To access this property do: RotationOrder.Get(). |
1414 | * To set this property do: RotationOrder.Set(EFbxRotationOrder). |
1415 | * Default value is eEulerXYZ. |
1416 | * |
1417 | */ |
1418 | FbxPropertyT<EFbxRotationOrder> RotationOrder; |
1419 | |
1420 | /** This property contains the rotation space for limit only flag of the node. |
1421 | * When set to \c true, the Rotation space is applied only on the limit data (provided the \ref RotationActive is |
1422 | * also \c true). |
1423 | * |
1424 | * To access this property do: RotationSpaceForLimitOnly.Get(). |
1425 | * To set this property do: RotationSpaceForLimitOnly.Set(FbxBool). |
1426 | * |
1427 | * Default value is false. |
1428 | */ |
1429 | FbxPropertyT<FbxBool> RotationSpaceForLimitOnly; |
1430 | |
1431 | /** This property contains the x value of the rotation stiffness of the node |
1432 | * |
1433 | * To access this property do: RotationStiffnessX.Get(). |
1434 | * To set this property do: RotationStiffnessX.Set(FbxDouble). |
1435 | * |
1436 | * Default value is 0. |
1437 | */ |
1438 | FbxPropertyT<FbxDouble> RotationStiffnessX; |
1439 | |
1440 | /** This property contains the y value of the rotation stiffness of the node |
1441 | * |
1442 | * To access this property do: RotationStiffnessY.Get(). |
1443 | * To set this property do: RotationStiffnessY.Set(FbxDouble). |
1444 | * |
1445 | * Default value is 0. |
1446 | */ |
1447 | FbxPropertyT<FbxDouble> RotationStiffnessY; |
1448 | |
1449 | /** This property contains the z value of the rotation stiffness of the node |
1450 | * |
1451 | * To access this property do: RotationStiffnessZ.Get(). |
1452 | * To set this property do: RotationStiffnessZ.Set(FbxDouble). |
1453 | * |
1454 | * Default value is 0. |
1455 | */ |
1456 | FbxPropertyT<FbxDouble> RotationStiffnessZ; |
1457 | |
1458 | /** This property contains axis length information of the node |
1459 | * |
1460 | * To access this property do: AxisLen.Get(). |
1461 | * To set this property do: AxisLen.Set(FbxDouble). |
1462 | * |
1463 | * Default value is 10. |
1464 | */ |
1465 | FbxPropertyT<FbxDouble> AxisLen; |
1466 | |
1467 | /** This property contains pre-rotation information of the node |
1468 | * |
1469 | * To access this property do: PreRotation.Get(). |
1470 | * To set this property do: PreRotation.Set(FbxDouble3). |
1471 | * |
1472 | * Default value is 0.,0.,0. |
1473 | */ |
1474 | FbxPropertyT<FbxDouble3> PreRotation; |
1475 | |
1476 | /** This property contains post-rotation information of the node |
1477 | * |
1478 | * To access this property do: PostRotation.Get(). |
1479 | * To set this property do: PostRotation.Set(FbxDouble3). |
1480 | * |
1481 | * Default value is 0.,0.,0. |
1482 | */ |
1483 | FbxPropertyT<FbxDouble3> PostRotation; |
1484 | |
1485 | /** This property enables or disables the limit on rotation. |
1486 | * When set to \c false the object can rotate in any direction without limitations. |
1487 | * Else the |
1488 | * \ref RotationMinX, \ref RotationMinY, \ref RotationMinZ, |
1489 | * \ref RotationMaxX, \ref RotationMaxY and \ref RotationMaxZ flags are used to |
1490 | * limit the rotation on each individual axis. |
1491 | * \remarks The PreRotation value is applied before the limit, while the PostRotation is applied |
1492 | * after the limit. |
1493 | * |
1494 | * To access this property do: RotationActive.Get(). |
1495 | * To set this property do: RotationActive.Set(FbxBool). |
1496 | * |
1497 | * Default value is false. |
1498 | */ |
1499 | FbxPropertyT<FbxBool> RotationActive; |
1500 | |
1501 | /** This property sets the minimum rotation values the object can occupy on each individual axis. |
1502 | * |
1503 | * To access this property do: RotationMin.Get(). |
1504 | * To set this property do: RotationMin.Set(FbxDouble3). |
1505 | * |
1506 | * Default value is 0.,0.,0. |
1507 | */ |
1508 | FbxPropertyT<FbxDouble3> RotationMin; |
1509 | |
1510 | /** This property sets the maximum rotation values the object can occupy on each individual axis. |
1511 | * |
1512 | * To access this property do: RotationMax.Get(). |
1513 | * To set this property do: RotationMax.Set(FbxDouble3). |
1514 | * |
1515 | * Default value is 0.,0.,0. |
1516 | */ |
1517 | FbxPropertyT<FbxDouble3> RotationMax; |
1518 | |
1519 | /** This property enables or disables the limit on rotation X. |
1520 | * When set to \c true, the object rotation is constrained by the value of \ref RotationMin. |
1521 | * |
1522 | * To access this property do: RotationMinX.Get(). |
1523 | * To set this property do: RotationMinX.Set(FbxBool). |
1524 | * |
1525 | * Default value is false. |
1526 | */ |
1527 | FbxPropertyT<FbxBool> RotationMinX; |
1528 | |
1529 | /** This property enables or disables the limit on rotation Y. |
1530 | * When set to \c true, the object rotation is constrained by the value of \ref RotationMin. |
1531 | * |
1532 | * To access this property do: RotationMinY.Get(). |
1533 | * To set this property do: RotationMinY.Set(FbxBool). |
1534 | * |
1535 | * Default value is false. |
1536 | */ |
1537 | FbxPropertyT<FbxBool> RotationMinY; |
1538 | |
1539 | /** This property enables or disables the limit on rotation Z. |
1540 | * When set to \c true, the object rotation is constrained by the value of \ref RotationMin. |
1541 | * |
1542 | * To access this property do: RotationMinZ.Get(). |
1543 | * To set this property do: RotationMinZ.Set(FbxBool). |
1544 | * |
1545 | * Default value is false. |
1546 | */ |
1547 | FbxPropertyT<FbxBool> RotationMinZ; |
1548 | |
1549 | /** This property enables or disables the limit on rotation X. |
1550 | * When set to \c true, the object rotation is constrained by the value of \ref RotationMax. |
1551 | * |
1552 | * To access this property do: RotationMaxX.Get(). |
1553 | * To set this property do: RotationMaxX.Set(FbxBool). |
1554 | * |
1555 | * Default value is false. |
1556 | */ |
1557 | FbxPropertyT<FbxBool> RotationMaxX; |
1558 | |
1559 | /** This property enables or disables the limit on rotation Y. |
1560 | * When set to \c true, the object rotation is constrained by the value of \ref RotationMax. |
1561 | * |
1562 | * To access this property do: RotationMaxY.Get(). |
1563 | * To set this property do: RotationMaxY.Set(FbxBool). |
1564 | * |
1565 | * Default value is false. |
1566 | */ |
1567 | FbxPropertyT<FbxBool> RotationMaxY; |
1568 | |
1569 | /** This property enables or disables the limit on rotation Z. |
1570 | * When set to \c true, the object rotation is constrained by the value of \ref RotationMax. |
1571 | * |
1572 | * To access this property do: RotationMaxZ.Get(). |
1573 | * To set this property do: RotationMaxZ.Set(FbxBool). |
1574 | * |
1575 | * Default value is false. |
1576 | */ |
1577 | FbxPropertyT<FbxBool> RotationMaxZ; |
1578 | |
1579 | /** This property contains inherit type information of the node |
1580 | * |
1581 | * To access this property do: InheritType.Get(). |
1582 | * To set this property do: InheritType.Set(FbxTransform::EInheritType). |
1583 | * |
1584 | * Default value is eInheritRrSs. |
1585 | */ |
1586 | FbxPropertyT<FbxTransform::EInheritType> InheritType; |
1587 | |
1588 | /** This property enables or disables the limit on scaling. |
1589 | * When set to \c false the object can scale in any direction without limitations. |
1590 | * Else the |
1591 | * \ref ScalingMinX, \ref ScalingMinY, \ref ScalingMinZ, |
1592 | * \ref ScalingMaxX, \ref ScalingMaxY and \ref ScalingMaxZ flags are used to |
1593 | * limit the scaling on each individual axis. |
1594 | * |
1595 | * To access this property do: ScalingActive.Get(). |
1596 | * To set this property do: ScalingActive.Set(FbxBool). |
1597 | * |
1598 | * Default value is false. |
1599 | */ |
1600 | FbxPropertyT<FbxBool> ScalingActive; |
1601 | |
1602 | /** This property sets the minimum scaling values the object can occupy on each individual axis. |
1603 | * |
1604 | * To access this property do: ScalingMin.Get(). |
1605 | * To set this property do: ScalingMin.Set(FbxDouble3). |
1606 | * |
1607 | * Default value is 0.,0.,0. |
1608 | */ |
1609 | FbxPropertyT<FbxDouble3> ScalingMin; |
1610 | |
1611 | /** This property sets the maximum scaling values the object can occupy on each individual axis. |
1612 | * |
1613 | * To access this property do: ScalingMax.Get(). |
1614 | * To set this property do: ScalingMax.Set(FbxDouble3). |
1615 | * |
1616 | * Default value is 1.,1.,1. |
1617 | */ |
1618 | FbxPropertyT<FbxDouble3> ScalingMax; |
1619 | |
1620 | /** This property activates or disables the limit on scaling X. When active, the object scaling |
1621 | * is constrained by the value of \ref ScalingMin. |
1622 | * |
1623 | * To access this property do: ScalingMinX.Get(). |
1624 | * To set this property do: ScalingMinX.Set(FbxBool). |
1625 | * |
1626 | * Default value is false. |
1627 | */ |
1628 | FbxPropertyT<FbxBool> ScalingMinX; |
1629 | |
1630 | /** This property enables or disables the limit on scaling Y. |
1631 | * When set to \c true, the object scaling is constrained by the value of \ref ScalingMin. |
1632 | * |
1633 | * To access this property do: ScalingMinY.Get(). |
1634 | * To set this property do: ScalingMinY.Set(FbxBool). |
1635 | * |
1636 | * Default value is false. |
1637 | */ |
1638 | FbxPropertyT<FbxBool> ScalingMinY; |
1639 | |
1640 | /** This property enables or disables the limit on scaling Z. |
1641 | * When set to \c true, the object scaling is constrained by the value of \ref ScalingMin. |
1642 | * |
1643 | * To access this property do: ScalingMinZ.Get(). |
1644 | * To set this property do: ScalingMinZ.Set(FbxBool). |
1645 | * |
1646 | * Default value is false. |
1647 | */ |
1648 | FbxPropertyT<FbxBool> ScalingMinZ; |
1649 | |
1650 | /** This property enables or disables the limit on scaling X. |
1651 | * When set to \c true, the object scaling is constrained by the value of \ref ScalingMax. |
1652 | * |
1653 | * To access this property do: ScalingMaxX.Get(). |
1654 | * To set this property do: ScalingMaxX.Set(FbxBool). |
1655 | * |
1656 | * Default value is false. |
1657 | */ |
1658 | FbxPropertyT<FbxBool> ScalingMaxX; |
1659 | |
1660 | /** This property enables or disables the limit on scaling Y. |
1661 | * When set to \c true, the object scaling is constrained by the value of \ref ScalingMax. |
1662 | * |
1663 | * To access this property do: ScalingMaxY.Get(). |
1664 | * To set this property do: ScalingMaxY.Set(FbxBool). |
1665 | * |
1666 | * Default value is false. |
1667 | */ |
1668 | FbxPropertyT<FbxBool> ScalingMaxY; |
1669 | |
1670 | /** This property enables or disables the limit on scaling Z. |
1671 | * When set to \c true, the object scaling is constrained by the value of \ref ScalingMax. |
1672 | * |
1673 | * To access this property do: ScalingMaxZ.Get(). |
1674 | * To set this property do: ScalingMaxZ.Set(FbxBool). |
1675 | * |
1676 | * Default value is false. |
1677 | */ |
1678 | FbxPropertyT<FbxBool> ScalingMaxZ; |
1679 | |
1680 | /** This property contains geometric translation information of the node |
1681 | * |
1682 | * To access this property do: GeometricTranslation.Get(). |
1683 | * To set this property do: GeometricTranslation.Set(FbxDouble3). |
1684 | * |
1685 | * Default value is 0.,0.,0. |
1686 | */ |
1687 | FbxPropertyT<FbxDouble3> GeometricTranslation; |
1688 | |
1689 | /** This property contains geometric rotation information of the node |
1690 | * |
1691 | * To access this property do: GeometricRotation.Get(). |
1692 | * To set this property do: GeometricRotation.Set(FbxDouble3). |
1693 | * |
1694 | * Default value is 0.,0.,0. |
1695 | */ |
1696 | FbxPropertyT<FbxDouble3> GeometricRotation; |
1697 | |
1698 | /** This property contains geometric scaling information of the node |
1699 | * |
1700 | * To access this property do: GeometricScaling.Get(). |
1701 | * To set this property do: GeometricScaling.Set(FbxDouble3). |
1702 | * |
1703 | * Default value is 1.,1.,1. |
1704 | */ |
1705 | FbxPropertyT<FbxDouble3> GeometricScaling; |
1706 | |
1707 | // IK Settings |
1708 | ////////////////////////////////////////////////////////// |
1709 | |
1710 | /** This property contains the x component of the minimum damp range angles of the node |
1711 | * |
1712 | * To access this property do: MinDampRangeX.Get(). |
1713 | * To set this property do: MinDampRangeX.Set(FbxDouble). |
1714 | * |
1715 | * Default value is 0. |
1716 | */ |
1717 | FbxPropertyT<FbxDouble> MinDampRangeX; |
1718 | |
1719 | /** This property contains the y component of the minimum damp range angles of the node |
1720 | * |
1721 | * To access this property do: MinDampRangeY.Get(). |
1722 | * To set this property do: MinDampRangeY.Set(FbxDouble). |
1723 | * |
1724 | * Default value is 0. |
1725 | */ |
1726 | FbxPropertyT<FbxDouble> MinDampRangeY; |
1727 | |
1728 | /** This property contains the z component of the minimum damp range angles of the node |
1729 | * |
1730 | * To access this property do: MinDampRangeZ.Get(). |
1731 | * To set this property do: MinDampRangeZ.Set(FbxDouble). |
1732 | * |
1733 | * Default value is 0. |
1734 | */ |
1735 | FbxPropertyT<FbxDouble> MinDampRangeZ; |
1736 | |
1737 | /** This property contains the x component of the maximum damp range angles of the node |
1738 | * |
1739 | * To access this property do: MaxDampRangeX.Get(). |
1740 | * To set this property do: MaxDampRangeX.Set(FbxDouble). |
1741 | * |
1742 | * Default value is 0. |
1743 | */ |
1744 | FbxPropertyT<FbxDouble> MaxDampRangeX; |
1745 | |
1746 | /** This property contains the y component of the maximum damp range angles of the node |
1747 | * |
1748 | * To access this property do: MaxDampRangeY.Get(). |
1749 | * To set this property do: MaxDampRangeY.Set(FbxDouble). |
1750 | * |
1751 | * Default value is 0. |
1752 | */ |
1753 | FbxPropertyT<FbxDouble> MaxDampRangeY; |
1754 | |
1755 | /** This property contains the z component of the maximum damp range angles of the node |
1756 | * |
1757 | * To access this property do: MaxDampRangeZ.Get(). |
1758 | * To set this property do: MaxDampRangeZ.Set(FbxDouble). |
1759 | * |
1760 | * Default value is 0. |
1761 | */ |
1762 | FbxPropertyT<FbxDouble> MaxDampRangeZ; |
1763 | |
1764 | /** This property contains the x component of the minimum damp strength of the node |
1765 | * |
1766 | * To access this property do: MinDampStrengthX.Get(). |
1767 | * To set this property do: MinDampStrengthX.Set(FbxDouble). |
1768 | * |
1769 | * Default value is 0. |
1770 | */ |
1771 | FbxPropertyT<FbxDouble> MinDampStrengthX; |
1772 | |
1773 | /** This property contains the y component of the minimum damp strength of the node |
1774 | * |
1775 | * To access this property do: MinDampStrengthY.Get(). |
1776 | * To set this property do: MinDampStrengthY.Set(FbxDouble). |
1777 | * |
1778 | * Default value is 0. |
1779 | */ |
1780 | FbxPropertyT<FbxDouble> MinDampStrengthY; |
1781 | |
1782 | /** This property contains the z component of the minimum damp strength of the node |
1783 | * |
1784 | * To access this property do: MinDampStrengthZ.Get(). |
1785 | * To set this property do: MinDampStrengthZ.Set(FbxDouble). |
1786 | * |
1787 | * Default value is 0. |
1788 | */ |
1789 | FbxPropertyT<FbxDouble> MinDampStrengthZ; |
1790 | |
1791 | /** This property contains the x component of the maximum damp strength of the node |
1792 | * |
1793 | * To access this property do: MaxDampStrengthX.Get(). |
1794 | * To set this property do: MaxDampStrengthX.Set(FbxDouble). |
1795 | * |
1796 | * Default value is 0. |
1797 | */ |
1798 | FbxPropertyT<FbxDouble> MaxDampStrengthX; |
1799 | |
1800 | /** This property contains the y component of the maximum damp strength of the node |
1801 | * |
1802 | * To access this property do: MaxDampStrengthY.Get(). |
1803 | * To set this property do: MaxDampStrengthY.Set(FbxDouble). |
1804 | * |
1805 | * Default value is 0. |
1806 | */ |
1807 | FbxPropertyT<FbxDouble> MaxDampStrengthY; |
1808 | |
1809 | /** This property contains the z component of the maximum damp strength of the node |
1810 | * |
1811 | * To access this property do: MaxDampStrengthZ.Get(). |
1812 | * To set this property do: MaxDampStrengthZ.Set(FbxDouble). |
1813 | * |
1814 | * Default value is 0. |
1815 | */ |
1816 | FbxPropertyT<FbxDouble> MaxDampStrengthZ; |
1817 | |
1818 | /** This property contains the x component of the preferred angle of the node |
1819 | * |
1820 | * To access this property do: PreferedAngleX.Get(). |
1821 | * To set this property do: PreferedAngleX.Set(FbxDouble). |
1822 | * |
1823 | * Default value is 0. |
1824 | */ |
1825 | FbxPropertyT<FbxDouble> PreferedAngleX; |
1826 | |
1827 | /** This property contains the y component of the preferred angle of the node |
1828 | * |
1829 | * To access this property do: PreferedAngleY.Get(). |
1830 | * To set this property do: PreferedAngleY.Set(FbxDouble). |
1831 | * |
1832 | * Default value is 0. |
1833 | */ |
1834 | FbxPropertyT<FbxDouble> PreferedAngleY; |
1835 | |
1836 | /** This property contains the z component of the preferred angle of the node |
1837 | * |
1838 | * To access this property do: PreferedAngleZ.Get(). |
1839 | * To set this property do: PreferedAngleZ.Set(FbxDouble). |
1840 | * |
1841 | * Default value is 0. |
1842 | */ |
1843 | FbxPropertyT<FbxDouble> PreferedAngleZ; |
1844 | |
1845 | /////////////////////////////////////////////////////// |
1846 | |
1847 | /** This property contains lookat property of the node |
1848 | * |
1849 | * To access this property do: LookAtProperty.Get(). |
1850 | * To set this property do: LookAtProperty.Set(FbxReference). |
1851 | * |
1852 | */ |
1853 | FbxPropertyT<FbxReference> LookAtProperty; |
1854 | |
1855 | /** This property contains the up vector property of the node |
1856 | * |
1857 | * To access this property do: UpVectorProperty.Get(). |
1858 | * To set this property do: UpVectorProperty.Set(FbxReference). |
1859 | * |
1860 | */ |
1861 | FbxPropertyT<FbxReference> UpVectorProperty; |
1862 | |
1863 | /** This property contains the show information of the node. |
1864 | * As opposed to the Visibility property, this one cannot be animated. The assumed behavior of |
1865 | * this property is to represent the show/hide state of all the nodes attributes connected to this |
1866 | * node only. |
1867 | * |
1868 | * To access this property do: Show.Get(). |
1869 | * To set this property do: Show.Set(FbxBool). |
1870 | * |
1871 | * Default value is true. |
1872 | * |
1873 | * \remarks \li Because node attributes can be shared by multiple nodes (instances), the FBX SDK provides an utility |
1874 | * function FbxScene::SyncShowPropertyForInstance() to propagates the same Show value across all the nodes |
1875 | * referencing the node attribute. The applied logic is that as soon as one of these nodes has the Show |
1876 | * property set to \c false, all will be set to \c false (basically it is an AND operation on all the |
1877 | * Show flags). |
1878 | * |
1879 | * \li Depending on the support of the Show and Visibility properties that applications will implement, there |
1880 | * may be conflicts with these two states. In this case, it is suggested that the Visibility property |
1881 | * always overrides the Show. |
1882 | * |
1883 | * \see Visibility property. |
1884 | */ |
1885 | FbxPropertyT<FbxBool> Show; |
1886 | |
1887 | /** This property contains negative percent shape support information of the node |
1888 | * |
1889 | * To access this property do: NegativePercentShapeSupport.Get(). |
1890 | * To set this property do: NegativePercentShapeSupport.Set(FbxBool). |
1891 | * |
1892 | * Default value is true. |
1893 | */ |
1894 | FbxPropertyT<FbxBool> NegativePercentShapeSupport; |
1895 | |
1896 | /** This property contains default attribute index information of the node |
1897 | * |
1898 | * To access this property do: DefaultAttributeIndex.Get(). |
1899 | * To set this property do: DefaultAttributeIndex.Set(FbxInt). |
1900 | * |
1901 | * Default value is -1. |
1902 | */ |
1903 | FbxPropertyT<FbxInt> DefaultAttributeIndex; |
1904 | |
1905 | /** This property contains manipulation state information of the node |
1906 | * |
1907 | * To access this property do: Freeze.Get(). |
1908 | * To set this property do: Freeze.Set(FbxBool). |
1909 | * |
1910 | * Default value is false. |
1911 | */ |
1912 | FbxPropertyT<FbxBool> Freeze; |
1913 | |
1914 | /** This property contains level of detail mode information of the node |
1915 | * |
1916 | * To access this property do: LODBox.Get(). |
1917 | * To set this property do: LODBox.Set(FbxBool). |
1918 | * |
1919 | * True: Bounding box |
1920 | * False: Geometry object is displayed. |
1921 | * Default value is false. |
1922 | */ |
1923 | FbxPropertyT<FbxBool> LODBox; |
1924 | //@} |
1925 | |
1926 | /***************************************************************************************************************************** |
1927 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
1928 | *****************************************************************************************************************************/ |
1929 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
1930 | class FBXSDK_DLL Pivot |
1931 | { |
1932 | public: |
1933 | static const FbxVector4 sZeroVector; |
1934 | static const FbxVector4 sOneVector; |
1935 | |
1936 | Pivot() |
1937 | { |
1938 | mRotationOffset = NULL; |
1939 | mRotationPivot = NULL; |
1940 | mPreRotation = NULL; |
1941 | mPostRotation = NULL; |
1942 | mScalingOffset = NULL; |
1943 | mScalingPivot = NULL; |
1944 | mGeometricTranslation = NULL; |
1945 | mGeometricRotation = NULL; |
1946 | mGeometricScaling = NULL; |
1947 | Reset(); |
1948 | } |
1949 | ~Pivot() { Reset(); } |
1950 | |
1951 | void Reset() |
1952 | { |
1953 | FBX_SAFE_DELETE(mRotationOffset); |
1954 | FBX_SAFE_DELETE(mRotationPivot); |
1955 | FBX_SAFE_DELETE(mPreRotation); |
1956 | FBX_SAFE_DELETE(mPostRotation); |
1957 | FBX_SAFE_DELETE(mScalingOffset); |
1958 | FBX_SAFE_DELETE(mScalingPivot); |
1959 | FBX_SAFE_DELETE(mGeometricTranslation); |
1960 | FBX_SAFE_DELETE(mGeometricRotation); |
1961 | FBX_SAFE_DELETE(mGeometricScaling); |
1962 | mRotationOrder = eEulerXYZ; |
1963 | mRotationSpaceForLimitOnly = false; |
1964 | mPivotState = FbxNode::ePivotReference; |
1965 | mQuaternionInterpolate = eQuatInterpOff; |
1966 | } |
1967 | |
1968 | inline const FbxVector4& GetRotationOffset() const { return (mRotationOffset) ? *mRotationOffset : sZeroVector; } |
1969 | inline void SetRotationOffset(const FbxVector4& pV) |
1970 | { |
1971 | if( !mRotationOffset ) |
1972 | { |
1973 | #if defined(__GNUC__) && (__GNUC__ < 4) |
1974 | mRotationOffset = FbxNew< FbxVector4 >((FbxVector4&)pV); |
1975 | #else |
1976 | mRotationOffset = FbxNew< FbxVector4 >(pV); |
1977 | #endif |
1978 | } |
1979 | else |
1980 | { |
1981 | *mRotationOffset = pV; |
1982 | } |
1983 | } |
1984 | |
1985 | inline const FbxVector4& GetRotationPivot() const { return (mRotationPivot) ? *mRotationPivot : sZeroVector; } |
1986 | inline void SetRotationPivot(const FbxVector4& pV) |
1987 | { |
1988 | if( !mRotationPivot ) |
1989 | { |
1990 | #if defined(__GNUC__) && (__GNUC__ < 4) |
1991 | mRotationPivot = FbxNew< FbxVector4 >((FbxVector4&)pV); |
1992 | #else |
1993 | mRotationPivot = FbxNew< FbxVector4 >(pV); |
1994 | #endif |
1995 | } |
1996 | else |
1997 | { |
1998 | *mRotationPivot = pV; |
1999 | } |
2000 | } |
2001 | |
2002 | inline const FbxVector4& GetPreRotation() const { return (mPreRotation) ? *mPreRotation : sZeroVector; } |
2003 | inline void SetPreRotation(const FbxVector4& pV) |
2004 | { |
2005 | if( !mPreRotation ) |
2006 | { |
2007 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2008 | mPreRotation = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2009 | #else |
2010 | mPreRotation = FbxNew< FbxVector4 >(pV); |
2011 | #endif |
2012 | } |
2013 | else |
2014 | { |
2015 | *mPreRotation = pV; |
2016 | } |
2017 | } |
2018 | |
2019 | inline const FbxVector4& GetPostRotation() const { return (mPostRotation) ? *mPostRotation : sZeroVector; } |
2020 | inline void SetPostRotation(const FbxVector4& pV) |
2021 | { |
2022 | if( !mPostRotation ) |
2023 | { |
2024 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2025 | mPostRotation = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2026 | #else |
2027 | mPostRotation = FbxNew< FbxVector4 >(pV); |
2028 | #endif |
2029 | } |
2030 | else |
2031 | { |
2032 | *mPostRotation = pV; |
2033 | } |
2034 | } |
2035 | |
2036 | inline const FbxVector4& GetScalingOffset() const { return (mScalingOffset) ? *mScalingOffset : sZeroVector; } |
2037 | inline void SetScalingOffset(const FbxVector4& pV) |
2038 | { |
2039 | if( !mScalingOffset ) |
2040 | { |
2041 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2042 | mScalingOffset = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2043 | #else |
2044 | mScalingOffset = FbxNew< FbxVector4 >(pV); |
2045 | #endif |
2046 | } |
2047 | else |
2048 | { |
2049 | *mScalingOffset = pV; |
2050 | } |
2051 | } |
2052 | |
2053 | inline const FbxVector4& GetScalingPivot() const { return (mScalingPivot) ? *mScalingPivot : sZeroVector; } |
2054 | inline void SetScalingPivot(const FbxVector4& pV) |
2055 | { |
2056 | if( !mScalingPivot ) |
2057 | { |
2058 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2059 | mScalingPivot = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2060 | #else |
2061 | mScalingPivot = FbxNew< FbxVector4 >(pV); |
2062 | #endif |
2063 | } |
2064 | else |
2065 | { |
2066 | *mScalingPivot = pV; |
2067 | } |
2068 | } |
2069 | |
2070 | inline const FbxVector4& GetGeometricTranslation() const { return (mGeometricTranslation) ? *mGeometricTranslation : sZeroVector; } |
2071 | inline void SetGeometricTranslation(const FbxVector4& pV) |
2072 | { |
2073 | if( !mGeometricTranslation ) |
2074 | { |
2075 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2076 | mGeometricTranslation = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2077 | #else |
2078 | mGeometricTranslation = FbxNew< FbxVector4 >(pV); |
2079 | #endif |
2080 | } |
2081 | else |
2082 | { |
2083 | *mGeometricTranslation = pV; |
2084 | } |
2085 | } |
2086 | |
2087 | inline const FbxVector4& GetGeometricRotation() const { return (mGeometricRotation) ? *mGeometricRotation : sZeroVector; } |
2088 | inline void SetGeometricRotation(const FbxVector4& pV) |
2089 | { |
2090 | if( !mGeometricRotation ) |
2091 | { |
2092 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2093 | mGeometricRotation = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2094 | #else |
2095 | mGeometricRotation = FbxNew< FbxVector4 >(pV); |
2096 | #endif |
2097 | } |
2098 | else |
2099 | { |
2100 | *mGeometricRotation = pV; |
2101 | } |
2102 | } |
2103 | |
2104 | inline const FbxVector4& GetGeometricScaling() const { return (mGeometricScaling) ? *mGeometricScaling : sOneVector; } |
2105 | inline void SetGeometricScaling(const FbxVector4& pV) |
2106 | { |
2107 | if( !mGeometricScaling ) |
2108 | { |
2109 | #if defined(__GNUC__) && (__GNUC__ < 4) |
2110 | mGeometricScaling = FbxNew< FbxVector4 >((FbxVector4&)pV); |
2111 | #else |
2112 | mGeometricScaling = FbxNew< FbxVector4 >(pV); |
2113 | #endif |
2114 | } |
2115 | else |
2116 | { |
2117 | *mGeometricScaling = pV; |
2118 | } |
2119 | } |
2120 | |
2121 | inline EFbxRotationOrder GetRotationOrder() const { return mRotationOrder; } |
2122 | inline void SetRotationOrder(EFbxRotationOrder pROrder) { mRotationOrder = pROrder; } |
2123 | inline bool GetRotationSpaceForLimitOnly() const { return mRotationSpaceForLimitOnly; } |
2124 | inline void SetRotationSpaceForLimitOnly(bool pVal) { mRotationSpaceForLimitOnly = pVal; } |
2125 | inline EFbxQuatInterpMode GetQuaternionInterpolate() const { return mQuaternionInterpolate; } |
2126 | inline void SetQuaternionInterpolate(EFbxQuatInterpMode pVal) { mQuaternionInterpolate = pVal; } |
2127 | inline FbxNode::EPivotState GetPivotState() const { return mPivotState; } |
2128 | inline void SetPivotState(FbxNode::EPivotState pVal) { mPivotState = pVal; } |
2129 | |
2130 | private: |
2131 | FbxVector4* mRotationOffset; |
2132 | FbxVector4* mRotationPivot; |
2133 | FbxVector4* mPreRotation; |
2134 | FbxVector4* mPostRotation; |
2135 | FbxVector4* mScalingOffset; |
2136 | FbxVector4* mScalingPivot; |
2137 | FbxVector4* mGeometricTranslation; |
2138 | FbxVector4* mGeometricRotation; |
2139 | FbxVector4* mGeometricScaling; |
2140 | EFbxRotationOrder mRotationOrder; |
2141 | bool mRotationSpaceForLimitOnly; |
2142 | EFbxQuatInterpMode mQuaternionInterpolate; |
2143 | FbxNode::EPivotState mPivotState; |
2144 | }; |
2145 | |
2146 | class FBXSDK_DLL Pivots |
2147 | { |
2148 | public: |
2149 | Pivots() |
2150 | { |
2151 | for( int i = 0; i < 2; i++ ) |
2152 | { |
2153 | mIsDefault[i] = true; |
2154 | mPivotState[i] = FbxNode::ePivotReference; |
2155 | mPivot[i] = NULL; |
2156 | } |
2157 | } |
2158 | |
2159 | ~Pivots() |
2160 | { |
2161 | FbxDelete(mPivot[0]); |
2162 | FbxDelete(mPivot[1]); |
2163 | } |
2164 | |
2165 | Pivot& Get(int id) |
2166 | { |
2167 | FBX_ASSERT(id == 0 || id == 1); |
2168 | if (mPivot[id] == NULL && mIsDefault[id]) |
2169 | { |
2170 | smDefaultPivot.SetPivotState(mPivotState[id]); |
2171 | return smDefaultPivot; |
2172 | } |
2173 | |
2174 | if (!mPivot[id]) |
2175 | mPivot[id] = FbxNew< Pivot >(); |
2176 | |
2177 | FBX_ASSERT(mPivot[id] != NULL); |
2178 | if (mPivot[id]) |
2179 | mPivot[id]->SetPivotState(mPivotState[id]); |
2180 | |
2181 | return *mPivot[id]; |
2182 | } |
2183 | |
2184 | #define MACRO_PIVOT_VECTOR_FCTS(name, defVect) \ |
2185 | inline const FbxVector4& Get##name(int id) const \ |
2186 | {\ |
2187 | FBX_ASSERT(id == 0 || id == 1); \ |
2188 | Pivot* p = mPivot[id]; \ |
2189 | if (p == NULL) p = &smDefaultPivot; \ |
2190 | return p->Get##name(); \ |
2191 | }\ |
2192 | inline void Set##name(int id, const FbxVector4& pV) \ |
2193 | {\ |
2194 | FBX_ASSERT(id == 0 || id == 1); \ |
2195 | if (mIsDefault[id] && pV[0] == defVect[0] && pV[1] == defVect[1] && pV[2] == defVect[2]) return; \ |
2196 | mIsDefault[id] = false; \ |
2197 | Get(id).Set##name(pV); \ |
2198 | } |
2199 | |
2200 | MACRO_PIVOT_VECTOR_FCTS(RotationOffset, Pivot::sZeroVector); |
2201 | MACRO_PIVOT_VECTOR_FCTS(RotationPivot, Pivot::sZeroVector); |
2202 | MACRO_PIVOT_VECTOR_FCTS(PreRotation, Pivot::sZeroVector); |
2203 | MACRO_PIVOT_VECTOR_FCTS(PostRotation, Pivot::sZeroVector); |
2204 | MACRO_PIVOT_VECTOR_FCTS(ScalingOffset, Pivot::sZeroVector); |
2205 | MACRO_PIVOT_VECTOR_FCTS(ScalingPivot, Pivot::sZeroVector); |
2206 | MACRO_PIVOT_VECTOR_FCTS(GeometricTranslation, Pivot::sZeroVector); |
2207 | MACRO_PIVOT_VECTOR_FCTS(GeometricRotation, Pivot::sZeroVector); |
2208 | MACRO_PIVOT_VECTOR_FCTS(GeometricScaling, Pivot::sOneVector); |
2209 | |
2210 | #define MACRO_PIVOT_BOOL_FCTS(name) \ |
2211 | inline bool Get##name(int id) const \ |
2212 | {\ |
2213 | FBX_ASSERT(id == 0 || id == 1); \ |
2214 | Pivot* p = mPivot[id]; \ |
2215 | if (p == NULL) p = &smDefaultPivot; \ |
2216 | return p->Get##name(); \ |
2217 | }\ |
2218 | inline void Set##name(int id, bool pV) \ |
2219 | {\ |
2220 | FBX_ASSERT(id == 0 || id == 1); \ |
2221 | mIsDefault[id] = false; \ |
2222 | Get(id).Set##name(pV); \ |
2223 | } |
2224 | |
2225 | MACRO_PIVOT_BOOL_FCTS(RotationSpaceForLimitOnly); |
2226 | |
2227 | inline EFbxQuatInterpMode GetQuaternionInterpolate(int id) const |
2228 | { |
2229 | FBX_ASSERT(id == 0 || id == 1); |
2230 | Pivot* p = mPivot[id]; |
2231 | if (p == NULL) p = &smDefaultPivot; |
2232 | return p->GetQuaternionInterpolate(); |
2233 | } |
2234 | |
2235 | inline void SetQuaternionInterpolate(int id, EFbxQuatInterpMode pV) |
2236 | { |
2237 | FBX_ASSERT(id == 0 || id == 1); |
2238 | // If pivot has default values, and we want to set default eQuatInterpOff, |
2239 | // return to avoid allocating memory for the pivot (in Get(id).) |
2240 | if (mIsDefault[id] && pV == eQuatInterpOff) return; |
2241 | mIsDefault[id] = false; |
2242 | Get(id).SetQuaternionInterpolate(pV); |
2243 | } |
2244 | |
2245 | inline EFbxRotationOrder GetRotationOrder(int id) const |
2246 | { |
2247 | FBX_ASSERT(id == 0 || id == 1); |
2248 | Pivot* p = mPivot[id]; |
2249 | if (p == NULL) p = &smDefaultPivot; |
2250 | return p->GetRotationOrder(); |
2251 | } |
2252 | |
2253 | inline void SetRotationOrder(int id, EFbxRotationOrder pROrder) |
2254 | { |
2255 | FBX_ASSERT(id == 0 || id == 1); |
2256 | // If pivot has default values, and we want to set default rotation order eEulerXYZ, |
2257 | // return to avoid allocating memory for the pivot (in Get(id).) |
2258 | if (mIsDefault[id] && pROrder == eEulerXYZ) return; |
2259 | mIsDefault[id] = false; |
2260 | Get(id).SetRotationOrder(pROrder); |
2261 | } |
2262 | |
2263 | inline FbxNode::EPivotState GetPivotState(int id) const |
2264 | { |
2265 | FBX_ASSERT(id == 0 || id == 1); |
2266 | return mPivotState[id]; |
2267 | } |
2268 | |
2269 | inline void SetPivotState(int id, FbxNode::EPivotState pVal) |
2270 | { |
2271 | FBX_ASSERT(id == 0 || id == 1); |
2272 | if (pVal == FbxNode::ePivotReference) return; |
2273 | mPivotState[id] = pVal; |
2274 | if (mPivot[id]) |
2275 | mPivot[id]->SetPivotState(pVal); |
2276 | } |
2277 | |
2278 | #undef MACRO_PIVOT_VECTOR_FCTS |
2279 | #undef MACRO_PIVOT_BOOL_FCTS |
2280 | |
2281 | void Reset() |
2282 | { |
2283 | smDefaultPivot.Reset(); |
2284 | for (int i = 0; i < 2; i++) |
2285 | { |
2286 | mIsDefault[i] = true; |
2287 | mPivotState[i] = FbxNode::ePivotReference; |
2288 | if (mPivot[i]) mPivot[i]->Reset(); |
2289 | } |
2290 | } |
2291 | |
2292 | private: |
2293 | Pivot* mPivot[2]; |
2294 | FbxNode::EPivotState mPivotState[2]; |
2295 | bool mIsDefault[2]; |
2296 | static Pivot smDefaultPivot; |
2297 | }; |
2298 | |
2299 | class FBXSDK_DLL LinkToCharacter |
2300 | { |
2301 | public: |
2302 | bool operator==(LinkToCharacter& pLinkToCharacter) |
2303 | { |
2304 | if (mCharacter == pLinkToCharacter.mCharacter && |
2305 | mType == pLinkToCharacter.mType && |
2306 | mIndex == pLinkToCharacter.mIndex && |
2307 | mSubIndex == pLinkToCharacter.mSubIndex) |
2308 | { |
2309 | return true; |
2310 | } |
2311 | else return false; |
2312 | } |
2313 | |
2314 | FbxCharacter* mCharacter; |
2315 | int mType; |
2316 | int mIndex; |
2317 | int mSubIndex; |
2318 | }; |
2319 | |
2320 | void AddChildName(char* pChildName); |
2321 | char* GetChildName(FbxUInt pIndex) const; |
2322 | FbxUInt GetChildNameCount() const; |
2323 | |
2324 | FbxTransform& GetTransform(); |
2325 | FbxLimits& GetTranslationLimits(); |
2326 | FbxLimits& GetRotationLimits(); |
2327 | FbxLimits& GetScalingLimits(); |
2328 | Pivots& GetPivots(); |
2329 | |
2330 | void UpdatePivotsAndLimitsFromProperties(); |
2331 | void UpdatePropertiesFromPivotsAndLimits(); |
2332 | |
2333 | void SetRotationActiveProperty(bool pVal); |
2334 | void PivotSetToMBTransform(EPivotSet pPivotSet); |
2335 | |
2336 | int AddCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId); |
2337 | int RemoveCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId); |
2338 | |
2339 | // Duplicate this node as well as all its node attributes and the Target and UpTarget objects. |
2340 | FbxNode* DeepCloneWithNodeAttributes(); |
2341 | |
2342 | virtual FbxObject& Copy(const FbxObject& pObject); |
2343 | virtual const char* GetTypeName() const; |
2344 | virtual FbxStringList GetTypeFlags() const; |
2345 | virtual bool PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty); |
2346 | |
2347 | enum ECullingType |
2348 | { |
2349 | eCullingOff, |
2350 | eCullingOnCCW, |
2351 | eCullingOnCW |
2352 | }; |
2353 | |
2354 | ECullingType mCullingType; |
2355 | bool mCorrectInheritType; |
2356 | |
2357 | protected: |
2358 | virtual void Construct(const FbxObject* pFrom); |
2359 | virtual void ConstructProperties(bool pForceSet); |
2360 | virtual void Destruct(bool pRecursive); |
2361 | |
2362 | void Reset(); |
2363 | bool GetAnimationIntervalRecursive(FbxTimeSpan& pTimeInterval, FbxAnimLayer* pAnimLayer); |
2364 | |
2365 | private: |
2366 | typedef FbxSet<FbxHandle> GeomInstSet; |
2367 | |
2368 | void ResetLimitsRecursive(FbxNode* pNode); |
2369 | |
2370 | void ConvertPivotAnimationRecurseLoop(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet); |
2371 | void ConvertPivotAnimation(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet); |
2372 | bool ConvertPivotAnimation_SetupMatrixConverter(FbxAnimCurveFilterMatrixConverter& pConverter, const EPivotSet& pSrcSet, const EPivotSet& pDstSet, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet); |
2373 | void ConvertPivotAnimation_ApplyGeometryPivot(const EPivotSet& pSrcSet, const EPivotSet& pDstSet, GeomInstSet& pGeomInstSet); |
2374 | |
2375 | FbxTransform mTransform; |
2376 | Pivots mPivots; |
2377 | FbxObject* mAnimCurveNodeContainer; |
2378 | FbxArray<FbxString*> mChildrenNameList; |
2379 | FbxVector4 mPostTargetRotation; |
2380 | FbxVector4 mTargetUpVector; |
2381 | FbxNode::EShadingMode mShadingMode; |
2382 | FbxArray<LinkToCharacter> mLinkToCharacter; |
2383 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
2384 | }; |
2385 | |
2386 | inline EFbxType FbxTypeOf(const EFbxRotationOrder&){ return eFbxEnum; } |
2387 | inline EFbxType FbxTypeOf(const FbxTransform::EInheritType&){ return eFbxEnum; } |
2388 | inline EFbxType FbxTypeOf(const EFbxQuatInterpMode&){ return eFbxEnum; } |
2389 | |
2390 | #include <fbxsdk/fbxsdk_nsend.h> |
2391 | |
2392 | #endif /* _FBXSDK_SCENE_GEOMETRY_NODE_H_ */ |
2393 | |