mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 04:37:59 +02:00
move setHandPosition from SkeletonModel to AvatarRig. Tell Rig::initJointStates joint-indexes for hands and elbows and shoulders
This commit is contained in:
parent
c80516a051
commit
241e767ab6
1 changed files with 4 additions and 3 deletions
|
@ -20,13 +20,14 @@ void AvatarRig::updateJointState(int index, glm::mat4 parentTransform) {
|
||||||
const FBXJoint& joint = state.getFBXJoint();
|
const FBXJoint& joint = state.getFBXJoint();
|
||||||
|
|
||||||
// compute model transforms
|
// compute model transforms
|
||||||
int parentIndex = joint.parentIndex;
|
if (index == _rootJointIndex) {
|
||||||
if (parentIndex == -1) {
|
// we always zero-out the translation part of an avatar's root join-transform.
|
||||||
state.computeTransform(parentTransform);
|
state.computeTransform(parentTransform);
|
||||||
clearJointTransformTranslation(index);
|
clearJointTransformTranslation(index);
|
||||||
} else {
|
} else {
|
||||||
// guard against out-of-bounds access to _jointStates
|
// guard against out-of-bounds access to _jointStates
|
||||||
if (joint.parentIndex >= 0 && joint.parentIndex < _jointStates.size()) {
|
int parentIndex = joint.parentIndex;
|
||||||
|
if (parentIndex >= 0 && parentIndex < _jointStates.size()) {
|
||||||
const JointState& parentState = _jointStates.at(parentIndex);
|
const JointState& parentState = _jointStates.at(parentIndex);
|
||||||
state.computeTransform(parentState.getTransform(), parentState.getTransformChanged());
|
state.computeTransform(parentState.getTransform(), parentState.getTransformChanged());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue