mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 15:29:05 +02:00
put back code that replaces previous parentID on release
This commit is contained in:
parent
eb4a2b0af5
commit
bff9e9be38
1 changed files with 14 additions and 2 deletions
|
@ -1363,7 +1363,10 @@ function MyController(hand) {
|
||||||
var okToEquipFromOtherHand = ((this.getOtherHandController().state == STATE_NEAR_GRABBING ||
|
var okToEquipFromOtherHand = ((this.getOtherHandController().state == STATE_NEAR_GRABBING ||
|
||||||
this.getOtherHandController().state == STATE_DISTANCE_HOLDING) &&
|
this.getOtherHandController().state == STATE_DISTANCE_HOLDING) &&
|
||||||
this.getOtherHandController().grabbedEntity == hotspot.entityID);
|
this.getOtherHandController().grabbedEntity == hotspot.entityID);
|
||||||
var hasParent = !(props.parentID === NULL_UUID);
|
var hasParent = true;
|
||||||
|
if (props.parentID === NULL_UUID) {
|
||||||
|
hasParent = false;
|
||||||
|
}
|
||||||
if ((hasParent || entityHasActions(hotspot.entityID)) && !okToEquipFromOtherHand) {
|
if ((hasParent || entityHasActions(hotspot.entityID)) && !okToEquipFromOtherHand) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
print("equip is skipping '" + props.name + "': grabbed by someone else");
|
print("equip is skipping '" + props.name + "': grabbed by someone else");
|
||||||
|
@ -1591,6 +1594,10 @@ function MyController(hand) {
|
||||||
// If near something grabbable, grab it!
|
// If near something grabbable, grab it!
|
||||||
if ((this.triggerSmoothedGrab() || this.secondarySqueezed()) && nearGrabEnabled) {
|
if ((this.triggerSmoothedGrab() || this.secondarySqueezed()) && nearGrabEnabled) {
|
||||||
this.setState(STATE_NEAR_GRABBING, "near grab '" + name + "'");
|
this.setState(STATE_NEAR_GRABBING, "near grab '" + name + "'");
|
||||||
|
var props = entityPropertiesCache.getProps(entity);
|
||||||
|
this.shouldResetParentOnRelease = true;
|
||||||
|
this.previousParentID = props.parentID;
|
||||||
|
this.previousParentJointIndex = props.parentJointIndex;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// potentialNearGrabEntity = entity;
|
// potentialNearGrabEntity = entity;
|
||||||
|
@ -2840,7 +2847,12 @@ function MyController(hand) {
|
||||||
Entities.deleteAction(this.grabbedEntity, this.actionID);
|
Entities.deleteAction(this.grabbedEntity, this.actionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entities.editEntity(this.grabbedEntity, { parentID: NULL_UUID }); // XXX
|
if (this.shouldResetParentOnRelease) {
|
||||||
|
Entities.editEntity(this.grabbedEntity, {
|
||||||
|
parentID: this.previousParentID,
|
||||||
|
parentJointIndex: this.previousParentJointIndex
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
|
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
|
||||||
action: 'release',
|
action: 'release',
|
||||||
|
|
Loading…
Reference in a new issue