HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H
8 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H
9 
10 /// \file usdSkelImaging/utils.h
11 ///
12 /// Collection of utility methods for imaging skels.
13 ///
14 
15 #include "pxr/pxr.h"
17 
18 #include "pxr/base/vt/array.h"
19 
20 
22 
23 
24 class HdMeshTopology;
25 class UsdSkelTopology;
26 
27 
28 /// \defgroup UsdSkelImaging_BoneUtils Bone Utilities
29 /// Utilities for constructing bone meshes.
30 /// @{
31 
32 
33 /// Compute mesh topology for imaging \p skelTopology.
34 /// The number of points that the mesh is expected to have are return in
35 /// \p numPoints.
37 bool
39  HdMeshTopology* meshTopology,
40  size_t* numPoints);
41 
42 
43 /// Compute mesh points for imaging a skeleton, given the
44 /// \p topology of the skeleton and \p skelXforms.
45 /// The \p numPoints corresponds to the number of points computed by
46 /// UsdSkelImagingComputeBoneTopology.
48 bool
50  const VtMatrix4dArray& jointSkelXforms,
51  size_t numPoints,
52  VtVec3fArray* points);
53 
54 /// \overload
56 bool
58  const GfMatrix4d* jointSkelXforms,
59  GfVec3f* points, size_t numPoints);
60 
61 
62 /// Compute joint indices corresponding to each point in a bone mesh.
63 /// This can be used to animate a bone mesh using normal skinning algos.
64 /// This does not compute joint weights (they would all be 1s).
65 /// The \p numPoints corresponds to the number of points computed by
66 /// UsdSkelImagingComputeBoneTopology.
68 bool
70  VtIntArray* jointIndices,
71  size_t numPoints);
72 
73 
74 /// \overload
76 bool
78  int* jointIndices, size_t numPoints);
79 
80 /// Compute mesh points for imaging a single bone of a skeleton.
81 ///
82 /// A bone corresponds to a joint that has a parent joint. The input to this
83 /// function is the transform of that joint and parent joint.
85 void
87  const GfMatrix4d& parentXform,
88  GfVec3f* points);
89 
90 /// @}
91 
92 
94 
95 
96 #endif // PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
USDSKELIMAGING_API bool UsdSkelImagingComputeBoneJointIndices(const UsdSkelTopology &topology, VtIntArray *jointIndices, size_t numPoints)
Definition: vec3f.h:45
USDSKELIMAGING_API bool UsdSkelImagingComputeBoneTopology(const UsdSkelTopology &skelTopology, HdMeshTopology *meshTopology, size_t *numPoints)
GT_API const UT_StringHolder topology
USDSKELIMAGING_API void UsdSkelImagingComputePointsForSingleBone(const GfMatrix4d &xform, const GfMatrix4d &parentXform, GfVec3f *points)
#define USDSKELIMAGING_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDSKELIMAGING_API bool UsdSkelImagingComputeBonePoints(const UsdSkelTopology &topology, const VtMatrix4dArray &jointSkelXforms, size_t numPoints, VtVec3fArray *points)