Fix grab behavior

This commit is contained in:
Atlante45 2015-12-07 17:08:36 -08:00
parent 353fe774ca
commit fc77d6cd40
2 changed files with 9 additions and 8 deletions

View file

@ -65,11 +65,6 @@ std::shared_ptr<Avatar> AvatarActionHold::getTarget(glm::quat& rotation, glm::ve
}
}
if (!isRightHand) {
static const glm::quat yFlip = glm::angleAxis(PI, Vectors::UNIT_Y);
palmRotation *= yFlip; // Match right hand frame of reference
}
rotation = palmRotation * _relativeRotation;
position = palmPosition + rotation * _relativePosition;
});
@ -218,14 +213,20 @@ bool AvatarActionHold::updateArguments(QVariantMap arguments) {
ok = true;
kinematic = EntityActionInterface::extractBooleanArgument("hold", arguments, "kinematic", ok, false);
if (!ok) {
_kinematic = false;
kinematic = _kinematic;
}
ok = true;
kinematicSetVelocity = EntityActionInterface::extractBooleanArgument("hold", arguments,
"kinematicSetVelocity", ok, false);
if (!ok) {
_kinematicSetVelocity = false;
kinematicSetVelocity = _kinematicSetVelocity;
}
ok = true;
ignoreIK = EntityActionInterface::extractBooleanArgument("hold", arguments, "ignoreIK", ok, false);
if (!ok) {
ignoreIK = _ignoreIK;
}
if (somethingChanged ||

View file

@ -50,7 +50,7 @@ private:
bool _kinematic { false };
bool _kinematicSetVelocity { false };
bool _previousSet { false };
bool _ignoreIK { true };
bool _ignoreIK { false };
glm::vec3 _previousPositionalTarget;
glm::quat _previousRotationalTarget;