Loading...
Searching...
No Matches
skeletonQuery.h
Go to the documentation of this file.
1//
2// Copyright 2016 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_USD_SKEL_SKELETON_QUERY_H
8#define PXR_USD_USD_SKEL_SKELETON_QUERY_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdSkel/api.h"
14
16#include "pxr/base/vt/types.h"
17
18#include "pxr/usd/usd/prim.h"
19
22
23
24PXR_NAMESPACE_OPEN_SCOPE
25
27class UsdSkelSkeleton;
28class UsdSkelTopology;
29
30TF_DECLARE_REF_PTRS(UsdSkel_SkelDefinition);
31
32
54{
55public:
57
59 bool IsValid() const { return _definition; }
60
62 explicit operator bool() const { return IsValid(); }
63
66 friend bool operator==(const UsdSkelSkeletonQuery& lhs,
67 const UsdSkelSkeletonQuery& rhs) {
68 return lhs._definition == rhs._definition &&
69 lhs._animQuery == rhs._animQuery;
70 }
71
74 friend bool operator!=(const UsdSkelSkeletonQuery& lhs,
75 const UsdSkelSkeletonQuery& rhs) {
76 return !(lhs == rhs);
77 }
78
81 USDSKEL_API
82 bool HasBindPose() const;
83
86 USDSKEL_API
87 bool HasRestPose() const;
88
89 // hash_value overload for std/boost hash.
90 USDSKEL_API
91 friend size_t hash_value(const UsdSkelSkeletonQuery& query);
92
95 USDSKEL_API
97
99 USDSKEL_API
101
104 USDSKEL_API
106
108 USDSKEL_API
110
113 USDSKEL_API
114 const UsdSkelAnimMapper& GetMapper() const;
115
120 USDSKEL_API
121 VtTokenArray GetJointOrder() const;
122
131 template <typename Matrix4>
132 USDSKEL_API
134 UsdTimeCode time,
135 bool atRest=false) const;
136
142 template <typename Matrix4>
143 USDSKEL_API
145 UsdTimeCode time,
146 bool atRest=false) const;
147
154 template <typename Matrix4>
155 USDSKEL_API
157 UsdTimeCode time) const;
158
166 template <typename Matrix4>
167 USDSKEL_API
169 UsdGeomXformCache* xfCache,
170 bool atRest=false) const;
171
181 template <typename Matrix4>
182 USDSKEL_API
184 UsdTimeCode time) const;
185
187 template <typename Matrix4>
188 USDSKEL_API
190
191 USDSKEL_API
192 std::string GetDescription() const;
193
194private:
195
196 USDSKEL_API
197 UsdSkelSkeletonQuery(const UsdSkel_SkelDefinitionRefPtr& definition,
198 const UsdSkelAnimQuery& anim=UsdSkelAnimQuery());
199
200 bool _HasMappableAnim() const;
201
202 template <typename Matrix4>
203 bool _ComputeJointLocalTransforms(VtArray<Matrix4>* xforms,
204 UsdTimeCode time,
205 bool atRest=false) const;
206
207 template <typename Matrix4>
208 bool _ComputeJointSkelTransforms(VtArray<Matrix4>* xforms,
209 UsdTimeCode time,
210 bool atRest=false) const;
211
212 template <typename Matrix4>
213 bool _ComputeSkinningTransforms(VtArray<Matrix4>* xforms,
214 UsdTimeCode time) const;
215
216private:
217 UsdSkel_SkelDefinitionRefPtr _definition;
218 UsdSkelAnimQuery _animQuery;
219 UsdSkelAnimMapper _animToSkelMapper;
220
221 friend class UsdSkel_CacheImpl;
222};
223
224
225PXR_NAMESPACE_CLOSE_SCOPE
226
227#endif // PXR_USD_USD_SKEL_SKELETON_QUERY_H
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
A caching mechanism for transform matrices.
Definition: xformCache.h:41
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
Class providing efficient queries of primitives that provide skel animation.
Definition: animQuery.h:38
Describes a skeleton.
Definition: skeleton.h:47
Primary interface to reading bound skeleton data.
Definition: skeletonQuery.h:54
USDSKEL_API bool ComputeJointWorldTransforms(VtArray< Matrix4 > *xforms, UsdGeomXformCache *xfCache, bool atRest=false) const
Compute joint transforms in world space, at whatever time is configured on xfCache.
USDSKEL_API bool ComputeJointRestRelativeTransforms(VtArray< Matrix4 > *xforms, UsdTimeCode time) const
Compute joint transforms which, when concatenated against the rest pose, produce joint transforms in ...
USDSKEL_API bool ComputeJointLocalTransforms(VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
Compute joint transforms in joint-local space, at time.
USDSKEL_API bool HasRestPose() const
Returns true if the size of the array returned by skeleton::GetRestTransformsAttr() matches the numbe...
USDSKEL_API const UsdSkelAnimMapper & GetMapper() const
Returns a mapper for remapping from the bound animation, if any, to the Skeleton.
USDSKEL_API bool ComputeJointSkelTransforms(VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
Compute joint transforms in skeleton space, at time.
USDSKEL_API const UsdSkelTopology & GetTopology() const
Returns the topology of the bound skeleton instance, if any.
friend bool operator!=(const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
Inequality comparison.
Definition: skeletonQuery.h:74
USDSKEL_API bool GetJointWorldBindTransforms(VtArray< Matrix4 > *xforms) const
Returns the world space joint transforms at bind time.
USDSKEL_API const UsdSkelSkeleton & GetSkeleton() const
Returns the bound skeleton instance, if any.
USDSKEL_API VtTokenArray GetJointOrder() const
Returns an array of joint paths, given as tokens, describing the order and parent-child relationships...
USDSKEL_API UsdPrim GetPrim() const
Returns the underlying Skeleton primitive corresponding to the bound skeleton instance,...
bool IsValid() const
Return true if this query is valid.
Definition: skeletonQuery.h:59
USDSKEL_API bool ComputeSkinningTransforms(VtArray< Matrix4 > *xforms, UsdTimeCode time) const
Compute transforms representing the change in transformation of a joint from its rest pose,...
USDSKEL_API bool HasBindPose() const
Returns true if the size of the array returned by skeleton::GetBindTransformsAttr() matches the numbe...
friend bool operator==(const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
Equality comparison.
Definition: skeletonQuery.h:66
USDSKEL_API const UsdSkelAnimQuery & GetAnimQuery() const
Returns the animation query that provides animation for the bound skeleton instance,...
Object holding information describing skeleton topology.
Definition: topology.h:29
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:72
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:213
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58