mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +02:00
Bug fixes for other Avatar root translation
This commit is contained in:
parent
c2ae6f0c8e
commit
27685e0425
3 changed files with 12 additions and 8 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "AvatarRig.h"
|
||||
|
||||
// AJT: REMOVE, this should no longer be used
|
||||
void AvatarRig::setHandPosition(int jointIndex,
|
||||
const glm::vec3& position, const glm::quat& rotation,
|
||||
float scale, float priority) {
|
||||
|
@ -90,7 +91,7 @@ void AvatarRig::setJointTranslation(int index, bool valid, const glm::vec3& tran
|
|||
}
|
||||
}
|
||||
|
||||
if (index > 0 && index < (int)_overrideFlags.size()) {
|
||||
if (index >= 0 && index < (int)_overrideFlags.size()) {
|
||||
if (valid) {
|
||||
assert(_overrideFlags.size() == _overridePoses.size());
|
||||
_overrideFlags[index] = true;
|
||||
|
@ -116,7 +117,7 @@ void AvatarRig::setJointState(int index, bool valid, const glm::quat& rotation,
|
|||
}
|
||||
}
|
||||
|
||||
if (index > 0 && index < (int)_overrideFlags.size()) {
|
||||
if (index >= 0 && index < (int)_overrideFlags.size()) {
|
||||
assert(_overrideFlags.size() == _overridePoses.size());
|
||||
_overrideFlags[index] = true;
|
||||
_overridePoses[index].rot = rotation;
|
||||
|
|
|
@ -12,10 +12,9 @@
|
|||
#include "EntityRig.h"
|
||||
|
||||
void EntityRig::setJointState(int index, bool valid, const glm::quat& rotation, const glm::vec3& translation, float priority) {
|
||||
if (index != -1 && index < _jointStates.size()) {
|
||||
|
||||
// AJT: LEGACY
|
||||
{
|
||||
// AJT: LEGACY
|
||||
{
|
||||
if (index != -1 && index < _jointStates.size()) {
|
||||
JointState& state = _jointStates[index];
|
||||
if (valid) {
|
||||
state.setRotationInConstrainedFrame(rotation, priority);
|
||||
|
@ -25,8 +24,12 @@ void EntityRig::setJointState(int index, bool valid, const glm::quat& rotation,
|
|||
// state.restoreTranslation(1.0f, priority);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (index >= 0 && index < (int)_overrideFlags.size()) {
|
||||
assert(_overrideFlags.size() == _overridePoses.size());
|
||||
_overrideFlags[index] = true;
|
||||
_overridePoses[index].rot = rotation;
|
||||
_overridePoses[index].trans = translation;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ bool Rig::getJointStateRotation(int index, glm::quat& rotation) const {
|
|||
|
||||
if (index >= 0 && index < (int)_relativePoses.size()) {
|
||||
rotation = _relativePoses[index].rot;
|
||||
return isEqual(rotation, _animSkeleton->getRelativeDefaultPose(index).rot);
|
||||
return !isEqual(rotation, _animSkeleton->getRelativeDefaultPose(index).rot);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ bool Rig::getJointStateTranslation(int index, glm::vec3& translation) const {
|
|||
|
||||
if (index >= 0 && index < (int)_relativePoses.size()) {
|
||||
translation = _relativePoses[index].trans;
|
||||
return isEqual(translation, _animSkeleton->getRelativeDefaultPose(index).trans);
|
||||
return !isEqual(translation, _animSkeleton->getRelativeDefaultPose(index).trans);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue