mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 12:23:24 +02:00
fix grab cloning parented entitiy
This commit is contained in:
parent
7905c91289
commit
0b9e520b53
3 changed files with 14 additions and 8 deletions
|
@ -3743,6 +3743,8 @@ bool EntityItemProperties::verifyStaticCertificateProperties() {
|
|||
void EntityItemProperties::convertToCloneProperties(const EntityItemID& entityIDToClone) {
|
||||
setName(getName() + "-clone-" + entityIDToClone.toString());
|
||||
setLocked(false);
|
||||
setParentID(QUuid());
|
||||
setParentJointIndex(-1);
|
||||
setLifetime(getCloneLifetime());
|
||||
setDynamic(getCloneDynamic());
|
||||
setClientOnly(getCloneAvatarEntity());
|
||||
|
|
|
@ -174,10 +174,12 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
|||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||
this.hapticTargetID = props.id;
|
||||
}
|
||||
// if we've attempted to grab a child, roll up to the root of the tree
|
||||
var groupRootProps = findGroupParent(controllerData, props);
|
||||
if (entityIsGrabbable(groupRootProps)) {
|
||||
return groupRootProps;
|
||||
if (!entityIsCloneable(props)) {
|
||||
// if we've attempted to grab a non-cloneable child, roll up to the root of the tree
|
||||
var groupRootProps = findGroupParent(controllerData, props);
|
||||
if (entityIsGrabbable(groupRootProps)) {
|
||||
return groupRootProps;
|
||||
}
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
|
|
@ -268,10 +268,12 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||
this.hapticTargetID = props.id;
|
||||
}
|
||||
// if we've attempted to grab a child, roll up to the root of the tree
|
||||
var groupRootProps = findGroupParent(controllerData, props);
|
||||
if (entityIsGrabbable(groupRootProps)) {
|
||||
return groupRootProps;
|
||||
if (!entityIsCloneable(props)) {
|
||||
// if we've attempted to grab a non-cloneable child, roll up to the root of the tree
|
||||
var groupRootProps = findGroupParent(controllerData, props);
|
||||
if (entityIsGrabbable(groupRootProps)) {
|
||||
return groupRootProps;
|
||||
}
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue