Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
state_error_function.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
9
16
17namespace momentum {
18
19namespace {
20
33template <typename T>
34Vector3<T> quaternionLogMapRelativeDerivativeQ1(
35 const Quaternion<T>& q1,
36 const Quaternion<T>& q2,
37 const Vector3<T>& dir,
38 const Eigen::Matrix<T, 3, 4>& dLogDq) {
39 // For q1: The perturbation is exp(t*v) * q1, so q_rel = q2^{-1} * (exp(t*v) * q1)
40 // We need d/dt [q2^{-1} * (exp(t*v) * q1)]|_{t=0}
41 //
42 // The derivative of exp(t*v) at t=0 in the direction v is a quaternion [0, v/2]
43 // Multiplying on the left gives: d/dt [exp(t*v) * q]|_{t=0} = [0, v/2] * q
44 //
45 // For a quaternion delta_q = [0, v/2] and q = [w, vec]:
46 // delta_q * q = [-(v/2)·vec, (v/2)*w + (v/2)×vec]
47
48 const Vector3<T> vHalf = dir / T(2);
49
50 // Compute d/dt [exp(t*v) * q1]|_{t=0} = [0, v/2] * q1
51 const Vector3<T> q1_vec(q1.x(), q1.y(), q1.z());
52 const T dq1_w = -vHalf.dot(q1_vec);
53 const Vector3<T> dq1_vec = vHalf * q1.w() + vHalf.cross(q1_vec);
54
55 // Then multiply by q2^{-1} on the left: q2^{-1} * [dq1_w, dq1_vec]
56 // Since q2^{-1} = [q2.w, -q2.vec]:
57 const Vector3<T> q2_vec(q2.x(), q2.y(), q2.z());
58 const T dqRel_w = q2.w() * dq1_w - (-q2_vec).dot(dq1_vec);
59 const Vector3<T> dqRel_vec = q2.w() * dq1_vec + dq1_w * (-q2_vec) + (-q2_vec).cross(dq1_vec);
60
61 // Apply chain rule: d(log)/d(t) = d(log)/d(q_rel) * d(q_rel)/d(t)
62 // q_rel.coeffs() = [x, y, z, w], so we need to arrange as [dqRel_vec, dqRel_w]
63 Eigen::Vector4<T> dqRelDt;
64 dqRelDt << dqRel_vec, dqRel_w;
65 return dLogDq * dqRelDt;
66}
67
70template <typename T>
71T computeLogMapRotationGradient(
72 const Quaternion<T>& rot,
73 const Quaternion<T>& target,
74 const Vector3<T>& axis,
75 const Eigen::Matrix<T, 3, 4>& dLogDq) {
76 // Compute the relative rotation: q_rel = target^{-1} * rot
77 const Quaternion<T> qRel = target.conjugate() * rot;
78
79 // Compute the logmap of the relative rotation
80 const Vector3<T> logmapVec = quaternionLogMap(qRel);
81
82 // Compute the derivative using quaternionLogMapRelativeDerivativeQ1
83 const Vector3<T> jacobian1 = quaternionLogMapRelativeDerivativeQ1(rot, target, axis, dLogDq);
84
85 // Apply chain rule for squared norm: d(||v||^2)/dparams = 2 * v^T * d(v)/dparams
86 return T(2) * logmapVec.dot(jacobian1);
87}
88
91template <typename T>
92T computeMatrixDiffRotationGradient(
93 const Quaternion<T>& rot,
94 const Quaternion<T>& target,
95 const Vector3<T>& axis) {
96 const auto rotD = crossProductMatrix(axis) * rot;
97 const Eigen::Matrix3<T> rotDiff = rot.toRotationMatrix() - target.toRotationMatrix();
98 return T(2) * rotD.cwiseProduct(rotDiff).sum();
99}
100
103template <typename T>
104Eigen::Matrix<T, 3, 1> computeLogMapRotationJacobian(
105 const Quaternion<T>& rot,
106 const Quaternion<T>& target,
107 const Vector3<T>& axis,
108 T weight,
109 const Eigen::Matrix<T, 3, 4>& dLogDq) {
110 // Compute the derivative using quaternionLogMapRelativeDerivativeQ1
111 return weight * quaternionLogMapRelativeDerivativeQ1(rot, target, axis, dLogDq);
112}
113
116template <typename T>
117Eigen::Matrix<T, 9, 1>
118computeMatrixDiffRotationJacobian(const Quaternion<T>& rot, const Vector3<T>& axis, T weight) {
119 const Eigen::Matrix3<T> rotD = crossProductMatrix(axis) * rot * weight;
120 return Map<const Eigen::Matrix<T, 9, 1>>(rotD.data(), rotD.size());
121}
122
123} // namespace
124
125template <typename T>
127 const Skeleton& skel,
128 const ParameterTransform& pt,
129 RotationErrorType rotationErrorType)
130 : SkeletonErrorFunctionT<T>(skel, pt), rotationErrorType_(rotationErrorType) {
131 targetPositionWeights_.setOnes(this->skeleton_.joints.size());
132 targetRotationWeights_.setOnes(this->skeleton_.joints.size());
133 posWgt_ = T(1);
134 rotWgt_ = T(1);
135}
136
137template <typename T>
139 const Character& character,
140 RotationErrorType rotationErrorType)
141 : StateErrorFunctionT<T>(character.skeleton, character.parameterTransform, rotationErrorType) {}
142
143template <typename T>
145 targetPositionWeights_.setOnes(this->skeleton_.joints.size());
146 targetRotationWeights_.setOnes(this->skeleton_.joints.size());
147}
148
149template <typename T>
151 MT_CHECK(target != nullptr);
152 setTargetState(*target);
153}
154
155template <typename T>
157 MT_CHECK(target.jointState.size() == this->skeleton_.joints.size());
159}
160
161template <typename T>
163 MT_CHECK(target.size() == this->skeleton_.joints.size());
164 this->targetState_ = std::move(target);
165}
166
167template <typename T>
168void StateErrorFunctionT<T>::setTargetWeight(const Eigen::VectorX<T>& weights) {
169 MT_CHECK(weights.size() == static_cast<Eigen::Index>(this->skeleton_.joints.size()));
170
171 targetPositionWeights_ = weights;
172 targetRotationWeights_ = weights;
173}
174
175template <typename T>
177 const Eigen::VectorX<T>& posWeight,
178 const Eigen::VectorX<T>& rotWeight) {
179 MT_CHECK(posWeight.size() == static_cast<Eigen::Index>(this->skeleton_.joints.size()));
180 MT_CHECK(rotWeight.size() == static_cast<Eigen::Index>(this->skeleton_.joints.size()));
181
182 targetPositionWeights_ = posWeight;
183 targetRotationWeights_ = rotWeight;
184}
185
186template <typename T>
187void StateErrorFunctionT<T>::setPositionTargetWeights(const Eigen::VectorX<T>& posWeight) {
188 MT_CHECK(posWeight.size() == static_cast<Eigen::Index>(this->skeleton_.joints.size()));
189 targetPositionWeights_ = posWeight;
190}
191
192template <typename T>
193void StateErrorFunctionT<T>::setRotationTargetWeights(const Eigen::VectorX<T>& rotWeight) {
194 MT_CHECK(rotWeight.size() == static_cast<Eigen::Index>(this->skeleton_.joints.size()));
195 targetRotationWeights_ = rotWeight;
196}
197
198template <typename T>
200 const ModelParametersT<T>& /* parameters */,
201 const SkeletonStateT<T>& state,
202 const MeshStateT<T>& /* meshState */) {
204
205 if (state.jointState.empty()) {
206 return 0.0;
207 }
208
209 // check all is valid
210 MT_CHECK(
211 state.jointParameters.size() ==
212 gsl::narrow<Eigen::Index>(this->skeleton_.joints.size() * kParametersPerJoint));
213
214 // loop over all joints and check for smoothness
215 double error = 0.0;
216
217 // ignore if we don't have any reasonable data
218 if (targetState_.size() != state.jointState.size()) {
219 return error;
220 }
221
222 // go over the joint states and calculate the rotation difference contribution on joints that are
223 // at the end
224 for (size_t i = 0; i < this->skeleton_.joints.size(); ++i) {
225 // calculate orientation error based on the selected error type
226 T rotationError = T(0);
227
228 const Eigen::Quaternion<T>& target = targetState_[i].rotation.normalized();
229 const Eigen::Quaternion<T>& rot = state.jointState[i].rotation();
230
231 switch (rotationErrorType_) {
233 // Compute the relative rotation: q_rel = target^{-1} * rot
234 const Eigen::Quaternion<T> qRel = target.conjugate() * rot;
235
236 // Compute the logmap of the relative rotation
237 const Eigen::Vector3<T> logmapVec = quaternionLogMap(qRel);
238
239 // The error is the squared norm of the logmap
240 rotationError = logmapVec.squaredNorm();
241 break;
242 }
244 // Note: |R0 - RT|² is a valid norm on SO3, it doesn't have the same slope as the squared
245 // angle difference but its derivative doesn't have a singularity at the minimum, so is more
246 // stable
247 const Eigen::Matrix3<T> rotDiff = rot.toRotationMatrix() - target.toRotationMatrix();
248 rotationError = rotDiff.squaredNorm();
249 break;
250 }
251 }
252
253 error += rotationError * kOrientationWeight * rotWgt_ * targetRotationWeights_[i];
254
255 // calculate position error
256 const Eigen::Vector3<T> diff = state.jointState[i].translation() - targetState_[i].translation;
257 error += diff.squaredNorm() * kPositionWeight * posWgt_ * targetPositionWeights_[i];
258 }
259
260 // return error
261 return error * this->weight_;
262}
263
264template <typename T>
266 const ModelParametersT<T>& /* params */,
267 const SkeletonStateT<T>& state,
268 const MeshStateT<T>& /* meshState */,
269 Ref<Eigen::VectorX<T>> gradient) {
271
272 if (state.jointState.empty()) {
273 return 0.0;
274 }
275
276 // loop over all joints and check for smoothness
277 double error = 0.0;
278
279 // check all is valid
280 MT_CHECK(
281 state.jointParameters.size() ==
282 gsl::narrow<Eigen::Index>(this->skeleton_.joints.size() * kParametersPerJoint));
283
284 // ignore if we don't have any reasonable data
285 if (targetState_.size() != state.jointState.size()) {
286 return error;
287 }
288
289 // also go over the joint states and calculate the rotation difference contribution on joints that
290 // are at the end
291 for (size_t i = 0; i < this->skeleton_.joints.size(); ++i) {
292 if (targetRotationWeights_[i] == 0 && targetPositionWeights_[i] == 0) {
293 continue;
294 }
295
296 // calculate orientation gradient
297 const Eigen::Quaternion<T>& target = targetState_[i].rotation.normalized();
298 const Eigen::Quaternion<T>& rot = state.jointState[i].rotation();
299
300 T rotationError = T(0);
301 Eigen::Matrix<T, 3, 4> dLogDq; // Precomputed derivative (only needed for logmap)
302
303 switch (rotationErrorType_) {
305 // Compute the relative rotation: q_rel = target^{-1} * rot
306 const Eigen::Quaternion<T> qRel = target.conjugate() * rot;
307
308 // Precompute the derivative of logmap w.r.t. quaternion components
309 // This will be reused for all 3 rotation axes
310 dLogDq = quaternionLogMapDerivative(qRel);
311
312 // Compute the logmap of the relative rotation
313 const Eigen::Vector3<T> logmapVec = quaternionLogMap(qRel);
314
315 // The error is the squared norm of the logmap
316 rotationError = logmapVec.squaredNorm();
317 break;
318 }
320 const Eigen::Matrix3<T> rotDiff = rot.toRotationMatrix() - target.toRotationMatrix();
321 rotationError = rotDiff.squaredNorm();
322 break;
323 }
324 }
325
326 const T rwgt = kOrientationWeight * rotWgt_ * this->weight_ * targetRotationWeights_[i];
327 error += rotationError * rwgt;
328
329 // calculate position gradient
330 const Eigen::Vector3<T> diff = state.jointState[i].translation() - targetState_[i].translation;
331 const T pwgt = kPositionWeight * posWgt_ * this->weight_ * targetPositionWeights_[i];
332 error += diff.squaredNorm() * pwgt;
333
334 // loop over all joints the constraint is attached to and calculate gradient
335 size_t jointIndex = i;
336 while (jointIndex != kInvalidIndex) {
337 // check for valid index
338 MT_CHECK(jointIndex < this->skeleton_.joints.size());
339
340 const size_t paramIndex = jointIndex * kParametersPerJoint;
341
342 // precalculate some more data for position gradient
343 const Eigen::Vector3<T> posd =
344 state.jointState[i].translation() - state.jointState[jointIndex].translation();
345
346 for (size_t d = 0; d < 3; d++) {
347 // position gradient
348 if (this->activeJointParams_[paramIndex + d]) {
349 // calculate joint gradient
350 const T val =
351 T(2) * diff.dot(state.jointState[jointIndex].getTranslationDerivative(d)) * pwgt;
353 val, paramIndex + d, this->parameterTransform_, gradient);
354 }
355 if (this->activeJointParams_[paramIndex + 3 + d]) {
356 // calculate joint gradient consisting of position gradient and orientation gradient
357 const Eigen::Vector3<T> axis = state.jointState[jointIndex].rotationAxis.col(d);
358
359 // Compute rotation gradient based on error type
360 T rotGradient;
361 switch (rotationErrorType_) {
363 rotGradient = computeLogMapRotationGradient(rot, target, axis, dLogDq);
364 break;
366 rotGradient = computeMatrixDiffRotationGradient(rot, target, axis);
367 break;
368 }
369
370 const T val =
371 T(2) * diff.dot(state.jointState[jointIndex].getRotationDerivative(d, posd)) * pwgt +
372 rwgt * rotGradient;
374 val, paramIndex + 3 + d, this->parameterTransform_, gradient);
375 }
376 }
377 if (this->activeJointParams_[paramIndex + 6]) {
378 // calculate joint gradient
379 const T val = T(2) * diff.dot(state.jointState[jointIndex].getScaleDerivative(posd)) * pwgt;
381 val, paramIndex + 6, this->parameterTransform_, gradient);
382 }
383
384 // go to the next joint
385 jointIndex = this->skeleton_.joints[jointIndex].parent;
386 }
387 }
388
389 // return error
390 return error;
391}
392
393template <typename T>
395 const auto nActiveJoints =
396 (targetPositionWeights_.array() != 0 || targetRotationWeights_.array() != 0).count();
397 if (rotationErrorType_ == RotationErrorType::QuaternionLogMap) {
398 // 3 (translation) + 3 (logmap) = 6 per joint
399 return nActiveJoints * 6;
400 } else {
401 // 3 (translation) + 9 (matrix) = 12 per joint
402 return nActiveJoints * 12;
403 }
404}
405
406template <typename T>
408 const ModelParametersT<T>& /* parameters */,
409 const SkeletonStateT<T>& state,
410 const MeshStateT<T>& /* meshState */,
411 Eigen::Ref<Eigen::MatrixX<T>> jacobian,
412 Eigen::Ref<Eigen::VectorX<T>> residual,
413 int& usedRows) {
415
416 // loop over all constraints and calculate the error
417 double error = 0.0;
418
419 // ignore if we don't have any reasonable data
420 if (targetState_.size() != state.jointState.size()) {
421 return error;
422 }
423
424 Eigen::Index offset = 0;
425
426 // calculate state difference jacobians
427 for (size_t i = 0; i < this->skeleton_.joints.size(); ++i) {
428 if (targetRotationWeights_[i] == 0 && targetPositionWeights_[i] == 0) {
429 continue;
430 }
431
432 // Determine block size based on rotation error type
433 // QuaternionLogMap: 3 (translation) + 3 (logmap) = 6
434 // RotationMatrixDifference: 3 (translation) + 9 (matrix) = 12
435 const size_t rotationResidualSize =
436 (rotationErrorType_ == RotationErrorType::QuaternionLogMap) ? 3 : 9;
437 const size_t blockSize = 3 + rotationResidualSize;
438
439 // calculate translation gradient
440 const auto transDiff = (state.jointState[i].translation() - targetState_[i].translation).eval();
441
442 // calculate orientation gradient and error
443 const Eigen::Quaternion<T>& target = targetState_[i].rotation.normalized();
444 const Eigen::Quaternion<T>& rot = state.jointState[i].rotation();
445
446 // calculate the difference between target and position and error
447 const T pwgt = kPositionWeight * posWgt_ * this->weight_ * targetPositionWeights_[i];
448 const T rwgt = kOrientationWeight * rotWgt_ * this->weight_ * targetRotationWeights_[i];
449 const T wgt = std::sqrt(pwgt);
450 const T awgt = std::sqrt(rwgt);
451 error += transDiff.squaredNorm() * pwgt;
452 residual.template segment<3>(offset).noalias() = transDiff * wgt;
453
454 Eigen::Matrix<T, 3, 4> dLogDq; // Precomputed derivative (only needed for logmap)
455 switch (rotationErrorType_) {
457 // Compute the relative rotation: q_rel = target^{-1} * rot
458 const Eigen::Quaternion<T> qRel = target.conjugate() * rot;
459
460 // Precompute the derivative of logmap w.r.t. quaternion components
461 // This will be reused for all 3 rotation axes
462 dLogDq = quaternionLogMapDerivative(qRel);
463
464 // Compute the logmap of the relative rotation
465 const Eigen::Vector3<T> logmapVec = quaternionLogMap(qRel);
466
467 // The error is the squared norm of the logmap
468 error += logmapVec.squaredNorm() * rwgt;
469
470 // The residual for Jacobian is the logmap vector itself (not squared)
471 // because we'll compute d(||log(q)||^2)/dparams = 2 * log(q)^T * d(log(q))/dparams
472 residual.template segment<3>(offset + 3).noalias() = logmapVec * awgt;
473 break;
474 }
476 // 9D RotationMatrixDifference
477 const Eigen::Matrix3<T> rotDiff = rot.toRotationMatrix() - target.toRotationMatrix();
478 error += rotDiff.squaredNorm() * rwgt;
479 residual.template segment<9>(offset + 3).noalias() =
480 Map<const Eigen::Matrix<T, 9, 1>>(rotDiff.data()) * awgt;
481 break;
482 }
483 }
484
485 // loop over all joints the constraint is attached to and calculate jacobian
486 size_t jointIndex = i;
487 while (jointIndex != kInvalidIndex) {
488 // check for valid index
489 MT_CHECK(jointIndex < this->skeleton_.joints.size());
490
491 const auto& jointState = state.jointState[jointIndex];
492 const size_t paramIndex = jointIndex * kParametersPerJoint;
493
494 // precalculate some more data for position gradient
495 const Eigen::Vector3<T> posd = state.jointState[i].translation() - jointState.translation();
496
497 // calculate derivatives based on active joints
498 for (size_t d = 0; d < 3; d++) {
499 if (this->activeJointParams_[paramIndex + d]) {
501 jointState.getTranslationDerivative(d) * wgt,
502 paramIndex + d,
503 this->parameterTransform_,
504 jacobian.template middleRows<3>(offset));
505 }
506
507 if (this->activeJointParams_[paramIndex + 3 + d]) {
508 // Translation part of rotation parameter jacobian
509 const Eigen::Vector3<T> jc = jointState.getRotationDerivative(d, posd) * wgt;
511 jc,
512 paramIndex + d + 3,
514 jacobian.template middleRows<3>(offset));
515
516 // The rotation direction (axis)
517 const Eigen::Vector3<T> axis = state.jointState[jointIndex].rotationAxis.col(d);
518
519 // Rotation part of rotation parameter jacobian
520 switch (rotationErrorType_) {
523 computeLogMapRotationJacobian(rot, target, axis, awgt, dLogDq),
524 paramIndex + d + 3,
526 jacobian.middleRows(offset + 3, rotationResidualSize));
527 break;
530 computeMatrixDiffRotationJacobian(rot, axis, awgt),
531 paramIndex + d + 3,
533 jacobian.middleRows(offset + 3, rotationResidualSize));
534 break;
535 }
536 }
537 }
538
539 if (this->activeJointParams_[paramIndex + 6]) {
540 // Scale implicitly affects translation
541 const Eigen::Vector3<T> jc = jointState.getScaleDerivative(posd) * wgt;
543 jc, paramIndex + 6, this->parameterTransform_, jacobian.template middleRows<3>(offset));
544 }
545
546 // go to the next joint
547 jointIndex = this->skeleton_.joints[jointIndex].parent;
548 }
549
550 // Move to next block
551 offset += blockSize;
552 }
553
554 usedRows = gsl::narrow_cast<int>(offset);
555
556 // return error
557 return error;
558}
559
560template class StateErrorFunctionT<float>;
561template class StateErrorFunctionT<double>;
562
563} // namespace momentum
#define MT_CHECK(condition,...)
Runtime check macros with two interchangeable backends:
Definition checks.h:36
SkeletonErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
const ParameterTransform & parameterTransform_
void setTargetWeights(const Eigen::VectorX< T > &posWeight, const Eigen::VectorX< T > &rotWeight)
double getJacobian(const ModelParametersT< T > &params, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) final
void setTargetState(const SkeletonStateT< T > *target)
StateErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt, RotationErrorType rotationErrorType=RotationErrorType::RotationMatrixDifference)
void setTargetWeight(const Eigen::VectorX< T > &weights)
double getError(const ModelParametersT< T > &params, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) final
double getGradient(const ModelParametersT< T > &params, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) final
void setRotationTargetWeights(const Eigen::VectorX< T > &rotWeight)
Set the target rotation weights for each joint.
void setPositionTargetWeights(const Eigen::VectorX< T > &posWeight)
Set the target position weights for each joint.
Eigen::Matrix< T, 3, 3 > crossProductMatrix(const Eigen::Vector3< T > &v)
Creates a skew-symmetric matrix for computing cross products.
Definition utility.h:343
RotationErrorType
Defines different methods for computing rotation error between two quaternions.
@ RotationMatrixDifference
Frobenius norm of rotation matrix difference: ||R1 - R2||_F^2.
@ QuaternionLogMap
Logarithmic map of relative rotation: ||log(R1^{-1} * R2)||^2.
SkeletonT< float > Skeleton
Definition fwd.h:263
std::vector< TransformT< T > > TransformListT
Per-joint transform list describing the state of all joints in a skeleton (one entry per joint,...
Definition transform.h:228
void jacobian_jointParams_to_modelParams(const Eigen::Ref< const Eigen::VectorX< T > > &jacobian_jointParams, const Eigen::Index iJointParam, const ParameterTransform &parameterTransform, Eigen::Ref< Eigen::MatrixX< T > > jacobian)
Vector3< T > quaternionLogMap(const Quaternion< T > &q)
Computes the logarithmic map from a quaternion to a rotation vector (axis-angle in R^3).
Definition utility.cpp:74
Eigen::Ref< T > Ref
Definition types.h:43
FloatP dot(const Eigen::MatrixBase< Derived > &v1, const Vector3P< S > &v2)
Computes dot product of Eigen::Vector3f and 3-vector of packets.
Definition simd.h:191
ParameterTransformT< float > ParameterTransform
Definition fwd.h:244
Eigen::Quaternion< T > Quaternion
Unit quaternion representing a 3D rotation.
Definition types.h:385
void gradient_jointParams_to_modelParams(const T &grad_jointParams, const Eigen::Index iJointParam, const ParameterTransform &parameterTransform, Eigen::Ref< Eigen::VectorX< T > > gradient)
constexpr size_t kParametersPerJoint
Definition types.h:21
constexpr size_t kInvalidIndex
Sentinel value indicating an invalid or unset size_t index.
Definition types.h:182
Vector< T, 3 > Vector3
Definition types.h:236
Eigen::Matrix< T, 3, 4 > quaternionLogMapDerivative(const Quaternion< T > &q)
Computes the derivative of the logarithmic map with respect to quaternion components.
Definition utility.cpp:120
Eigen::Map< T > Map
Definition types.h:40
Profiling macros that dispatch to one of three backends, selected at compile time:
#define MT_PROFILE_FUNCTION()
Definition profile.h:110
A character model with skeletal structure, mesh, and optional components.
Definition character.h:32
Represents the complete state of a model's mesh.
Definition mesh_state.h:24
A vector of size numModelParams holding the values of all model parameters for a character.
Definition types.h:99
Represents the complete state of a skeleton.
JointParametersT< T > jointParameters
Joint parameters for all joints in the skeleton.
TransformListT< T > toTransforms() const
Extracts global transforms for all joints in the skeleton.
JointStateListT< T > jointState
Computed joint states for all joints in the skeleton.