mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
fix SpatiallyNestable::getChildren
This commit is contained in:
parent
5594f1e4e5
commit
5bf8670bc2
3 changed files with 6 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
"use strict";
|
||||
// handControllerGrab.js
|
||||
//
|
||||
// Created by Eric Levin on 9/2/15
|
||||
|
@ -1766,7 +1767,7 @@ function MyController(hand) {
|
|||
var handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand");
|
||||
var children = Entities.getChildrenIDsOfJoint(MyAvatar.sessionUUID, handJointIndex);
|
||||
children.forEach(function(childID) {
|
||||
print("disconnecting stray child of hand: " + childID);
|
||||
print("disconnecting stray child of hand: (" + _this.hand + ") " + childID);
|
||||
Entities.editEntity(childID, {parentID: NULL_UUID});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1084,7 +1084,9 @@ QVector<QUuid> EntityScriptingInterface::getChildrenIDsOfJoint(const QUuid& pare
|
|||
return;
|
||||
}
|
||||
parent->forEachChild([&](SpatiallyNestablePointer child) {
|
||||
result.push_back(child->getID());
|
||||
if (child->getParentJointIndex() == jointIndex) {
|
||||
result.push_back(child->getID());
|
||||
}
|
||||
});
|
||||
});
|
||||
return result;
|
||||
|
|
|
@ -682,7 +682,7 @@ QList<SpatiallyNestablePointer> SpatiallyNestable::getChildren() const {
|
|||
_childrenLock.withReadLock([&] {
|
||||
foreach(SpatiallyNestableWeakPointer childWP, _children.values()) {
|
||||
SpatiallyNestablePointer child = childWP.lock();
|
||||
if (child) {
|
||||
if (child && child->_parentKnowsMe && child->getParentID() == getID()) {
|
||||
children << child;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue