mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 12:09:52 +02:00
Rig: getJointRotation and getJointTranslation use _relativePoses
This commit is contained in:
parent
923d60e452
commit
df7ca3bc38
1 changed files with 25 additions and 6 deletions
|
@ -444,19 +444,38 @@ bool Rig::getJointRotationInWorldFrame(int jointIndex, glm::quat& result, const
|
||||||
// Deprecated.
|
// Deprecated.
|
||||||
// WARNING: this is not symmetric with setJointRotation. It's historical. Use the appropriate specific variation.
|
// WARNING: this is not symmetric with setJointRotation. It's historical. Use the appropriate specific variation.
|
||||||
bool Rig::getJointRotation(int jointIndex, glm::quat& rotation) const {
|
bool Rig::getJointRotation(int jointIndex, glm::quat& rotation) const {
|
||||||
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
|
|
||||||
|
// AJT: LEGACY
|
||||||
|
{
|
||||||
|
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
rotation = _jointStates[jointIndex].getRotation();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jointIndex >= 0 && jointIndex < _relativePoses.size()) {
|
||||||
|
rotation = _relativePoses[jointIndex].rot;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
rotation = _jointStates[jointIndex].getRotation();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Rig::getJointTranslation(int jointIndex, glm::vec3& translation) const {
|
bool Rig::getJointTranslation(int jointIndex, glm::vec3& translation) const {
|
||||||
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
|
// AJT: LEGACY
|
||||||
|
{
|
||||||
|
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
translation = _jointStates[jointIndex].getTranslation();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jointIndex >= 0 && jointIndex < _relativePoses.size()) {
|
||||||
|
translation = _relativePoses[jointIndex].trans;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
translation = _jointStates[jointIndex].getTranslation();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Rig::getJointCombinedRotation(int jointIndex, glm::quat& result, const glm::quat& rotation) const {
|
bool Rig::getJointCombinedRotation(int jointIndex, glm::quat& result, const glm::quat& rotation) const {
|
||||||
|
|
Loading…
Reference in a new issue