Merge pull request #6508 from sethalves/fix-observers-dont-see-equip-motion

possible fix for observers not seeing a held entity moving
This commit is contained in:
Philip Rosedale 2015-12-01 11:41:08 -08:00
commit 8e40889068
2 changed files with 12 additions and 3 deletions

View file

@ -479,7 +479,11 @@ function MyController(hand) {
this.setState(STATE_NEAR_GRABBING); this.setState(STATE_NEAR_GRABBING);
} else { // equipping } else { // equipping
if (typeof grabbableData.spatialKey !== 'undefined') { 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 { } else {
this.setState(STATE_EQUIP); this.setState(STATE_EQUIP);
} }
@ -493,7 +497,9 @@ function MyController(hand) {
this.grabbedEntity = intersection.entityID; this.grabbedEntity = intersection.entityID;
if (typeof grabbableData.spatialKey !== 'undefined' && this.state == STATE_EQUIP_SEARCHING) { if (typeof grabbableData.spatialKey !== 'undefined' && this.state == STATE_EQUIP_SEARCHING) {
// if a distance pick in equip mode hits something with a spatialKey, equip it // 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; return;
} else if (this.state == STATE_SEARCHING) { } else if (this.state == STATE_SEARCHING) {
this.setState(STATE_DISTANCE_HOLDING); this.setState(STATE_DISTANCE_HOLDING);

View file

@ -106,6 +106,7 @@ void AvatarActionHold::updateActionWorker(float deltaTimeStep) {
doKinematicUpdate(deltaTimeStep); doKinematicUpdate(deltaTimeStep);
} else { } else {
activateBody(); activateBody();
forceBodyNonStatic();
ObjectActionSpring::updateActionWorker(deltaTimeStep); ObjectActionSpring::updateActionWorker(deltaTimeStep);
} }
} }
@ -156,6 +157,7 @@ void AvatarActionHold::doKinematicUpdate(float deltaTimeStep) {
}); });
activateBody(); activateBody();
forceBodyNonStatic();
} }
bool AvatarActionHold::updateArguments(QVariantMap arguments) { bool AvatarActionHold::updateArguments(QVariantMap arguments) {
@ -328,5 +330,6 @@ void AvatarActionHold::deserialize(QByteArray serializedArguments) {
_active = true; _active = true;
}); });
activateBody();
forceBodyNonStatic(); forceBodyNonStatic();
} }