From 11f18c3ada314f5aa5712677f8450562f88f8cea Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 1 Dec 2015 09:52:51 -0800 Subject: [PATCH 1/2] also make sure the holder doesn't end up with a static-in-bullet held object --- interface/src/avatar/AvatarActionHold.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/avatar/AvatarActionHold.cpp b/interface/src/avatar/AvatarActionHold.cpp index dd96b3a3d9..3baffd5b6b 100644 --- a/interface/src/avatar/AvatarActionHold.cpp +++ b/interface/src/avatar/AvatarActionHold.cpp @@ -106,6 +106,7 @@ void AvatarActionHold::updateActionWorker(float deltaTimeStep) { doKinematicUpdate(deltaTimeStep); } else { activateBody(); + forceBodyNonStatic(); ObjectActionSpring::updateActionWorker(deltaTimeStep); } } @@ -156,6 +157,7 @@ void AvatarActionHold::doKinematicUpdate(float deltaTimeStep) { }); activateBody(); + forceBodyNonStatic(); } bool AvatarActionHold::updateArguments(QVariantMap arguments) { From 7f95e1eec68f53ad31c4523ebbed9551c897aa47 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 1 Dec 2015 10:49:07 -0800 Subject: [PATCH 2/2] make sure observed held objects are active in bullet, disable equip spring action --- examples/controllers/handControllerGrab.js | 12 +++++++++--- interface/src/avatar/AvatarActionHold.cpp | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 0812dc8980..d4e926ab0d 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -479,7 +479,11 @@ function MyController(hand) { this.setState(STATE_NEAR_GRABBING); } else { // equipping if (typeof grabbableData.spatialKey !== 'undefined') { - this.setState(STATE_EQUIP_SPRING); + // TODO + // if we go to STATE_EQUIP_SPRING the item will be pulled to the hand and will then switch + // to STATE_EQUIP. This needs some debugging, so just jump straight to STATE_EQUIP here. + // this.setState(STATE_EQUIP_SPRING); + this.setState(STATE_EQUIP); } else { this.setState(STATE_EQUIP); } @@ -493,7 +497,9 @@ function MyController(hand) { this.grabbedEntity = intersection.entityID; if (typeof grabbableData.spatialKey !== 'undefined' && this.state == STATE_EQUIP_SEARCHING) { // if a distance pick in equip mode hits something with a spatialKey, equip it - this.setState(STATE_EQUIP_SPRING); + // TODO use STATE_EQUIP_SPRING here once it works right. + // this.setState(STATE_EQUIP_SPRING); + this.setState(STATE_EQUIP); return; } else if (this.state == STATE_SEARCHING) { this.setState(STATE_DISTANCE_HOLDING); @@ -1248,4 +1254,4 @@ function cleanup() { } Script.scriptEnding.connect(cleanup); -Script.update.connect(update); \ No newline at end of file +Script.update.connect(update); diff --git a/interface/src/avatar/AvatarActionHold.cpp b/interface/src/avatar/AvatarActionHold.cpp index 3baffd5b6b..b06d66a035 100644 --- a/interface/src/avatar/AvatarActionHold.cpp +++ b/interface/src/avatar/AvatarActionHold.cpp @@ -330,5 +330,6 @@ void AvatarActionHold::deserialize(QByteArray serializedArguments) { _active = true; }); + activateBody(); forceBodyNonStatic(); }