mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 14:42:19 +02:00
more logging for fogbugz 11748
This commit is contained in:
parent
acda90577a
commit
bf73df1265
1 changed files with 16 additions and 4 deletions
|
@ -434,9 +434,13 @@ void Rig::setJointRotation(int index, bool valid, const glm::quat& rotation, flo
|
|||
|
||||
bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm::vec3 translation, glm::quat rotation) const {
|
||||
bool success { false };
|
||||
if (QThread::currentThread() == thread()) {
|
||||
glm::vec3 originalPosition = position;
|
||||
bool onOwnerThread = (QThread::currentThread() == thread());
|
||||
glm::vec3 poseSetTrans;
|
||||
if (onOwnerThread) {
|
||||
if (isIndexValid(jointIndex)) {
|
||||
position = (rotation * _internalPoseSet._absolutePoses[jointIndex].trans()) + translation;
|
||||
poseSetTrans = _internalPoseSet._absolutePoses[jointIndex].trans();
|
||||
position = (rotation * poseSetTrans) + translation;
|
||||
success = true;
|
||||
} else {
|
||||
success = false;
|
||||
|
@ -444,7 +448,8 @@ bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm:
|
|||
} else {
|
||||
QReadLocker readLock(&_externalPoseSetLock);
|
||||
if (jointIndex >= 0 && jointIndex < (int)_externalPoseSet._absolutePoses.size()) {
|
||||
position = (rotation * _externalPoseSet._absolutePoses[jointIndex].trans()) + translation;
|
||||
poseSetTrans = _externalPoseSet._absolutePoses[jointIndex].trans();
|
||||
position = (rotation * poseSetTrans) + translation;
|
||||
success = true;
|
||||
} else {
|
||||
success = false;
|
||||
|
@ -452,7 +457,14 @@ bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm:
|
|||
}
|
||||
|
||||
if (isNaN(position)) {
|
||||
qCWarning(animation) << "Rig::getJointPositionInWorldFrame produces NaN";
|
||||
qCWarning(animation) << "Rig::getJointPositionInWorldFrame produced NaN."
|
||||
<< " is owner thread = " << onOwnerThread
|
||||
<< " position = " << originalPosition
|
||||
<< " translation = " << translation
|
||||
<< " rotation = " << rotation
|
||||
<< " poseSetTrans = " << poseSetTrans
|
||||
<< " success = " << success
|
||||
<< " jointIndex = " << jointIndex;
|
||||
success = false;
|
||||
position = glm::vec3(0.0f);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue