mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
when breaking a parenting loop, make an effort to keep the object near where it was when the loop was created
This commit is contained in:
parent
3abc7d854a
commit
bb9d1556c6
1 changed files with 7 additions and 1 deletions
|
@ -519,7 +519,13 @@ const Transform SpatiallyNestable::getTransform(int jointIndex, bool& success, i
|
|||
success = false;
|
||||
// someone created a loop. break it...
|
||||
qDebug() << "Parenting loop detected.";
|
||||
getThisPointer()->setParentID(QUuid());
|
||||
SpatiallyNestablePointer _this = getThisPointer();
|
||||
_this->setParentID(QUuid());
|
||||
bool setPositionSuccess;
|
||||
AACube aaCube = getQueryAACube(setPositionSuccess);
|
||||
if (setPositionSuccess) {
|
||||
_this->setPosition(aaCube.calcCenter());
|
||||
}
|
||||
return jointInWorldFrame;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue