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 Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H
25 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_UTILS_H
26 
27 /// \file usdSkelImaging/utils.h
28 ///
29 /// Collection of utility methods for imaging skels.
30 ///
31 
32 #include "pxr/pxr.h"
34 
35 #include "pxr/base/vt/array.h"
36 
37 
39 
40 
41 class HdMeshTopology;
42 class UsdSkelTopology;
43 
44 
45 /// \defgroup UsdSkelImaging_BoneUtils Bone Utilities
46 /// Utilities for constructing bone meshes.
47 /// @{
48 
49 
50 /// Compute mesh topology for imaging \p skelTopology.
51 /// The number of points that the mesh is expected to have are return in
52 /// \p numPoints.
54 bool
56  HdMeshTopology* meshTopology,
57  size_t* numPoints);
58 
59 
60 /// Compute mesh points for imaging a skeleton, given the
61 /// \p topology of the skeleton and \p skelXforms.
62 /// The \p numPoints corresponds to the number of points computed by
63 /// UsdSkelImagingComputeBoneTopology.
65 bool
67  const VtMatrix4dArray& jointSkelXforms,
68  size_t numPoints,
69  VtVec3fArray* points);
70 
71 /// \overload
73 bool
75  const GfMatrix4d* jointSkelXforms,
76  GfVec3f* points, size_t numPoints);
77 
78 
79 /// Compute joint indices corresponding to each point in a bone mesh.
80 /// This can be used to animate a bone mesh using normal skinning algos.
81 /// This does not compute joint weights (they would all be 1s).
82 /// The \p numPoints corresponds to the number of points computed by
83 /// UsdSkelImagingComputeBoneTopology.
85 bool
87  VtIntArray* jointIndices,
88  size_t numPoints);
89 
90 
91 /// \overload
93 bool
95  int* jointIndices, size_t numPoints);
96 
97 /// @}
98 
99 
101 
102 
103 #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:62
USDSKELIMAGING_API bool UsdSkelImagingComputeBoneTopology(const UsdSkelTopology &skelTopology, HdMeshTopology *meshTopology, size_t *numPoints)
GT_API const UT_StringHolder topology
#define USDSKELIMAGING_API
Definition: api.h:40
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDSKELIMAGING_API bool UsdSkelImagingComputeBonePoints(const UsdSkelTopology &topology, const VtMatrix4dArray &jointSkelXforms, size_t numPoints, VtVec3fArray *points)