mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:29:40 +02:00
Merge pull request #8477 from sethalves/fix-grab-ignore-ik-1
ignoreIK flag on action-grabbable objects works again
This commit is contained in:
commit
6c80a35c4b
1 changed files with 3 additions and 5 deletions
|
@ -1674,12 +1674,12 @@ function MyController(hand) {
|
||||||
var handRotation = (this.hand === RIGHT_HAND) ? MyAvatar.getRightPalmRotation() : MyAvatar.getLeftPalmRotation();
|
var handRotation = (this.hand === RIGHT_HAND) ? MyAvatar.getRightPalmRotation() : MyAvatar.getLeftPalmRotation();
|
||||||
var handPosition = this.getHandPosition();
|
var handPosition = this.getHandPosition();
|
||||||
|
|
||||||
var hasPresetPosition = false;
|
|
||||||
if (this.state == STATE_HOLD && this.grabbedHotspot) {
|
|
||||||
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedEntity, DEFAULT_GRABBABLE_DATA);
|
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedEntity, DEFAULT_GRABBABLE_DATA);
|
||||||
// if an object is "equipped" and has a predefined offset, use it.
|
|
||||||
this.ignoreIK = grabbableData.ignoreIK ? grabbableData.ignoreIK : false;
|
this.ignoreIK = grabbableData.ignoreIK ? grabbableData.ignoreIK : false;
|
||||||
|
|
||||||
|
var hasPresetPosition = false;
|
||||||
|
if (this.state == STATE_HOLD && this.grabbedHotspot) {
|
||||||
|
// if an object is "equipped" and has a predefined offset, use it.
|
||||||
var offsets = USE_ATTACH_POINT_SETTINGS && getAttachPointForHotspotFromSettings(this.grabbedHotspot, this.hand);
|
var offsets = USE_ATTACH_POINT_SETTINGS && getAttachPointForHotspotFromSettings(this.grabbedHotspot, this.hand);
|
||||||
if (offsets) {
|
if (offsets) {
|
||||||
this.offsetPosition = offsets[0];
|
this.offsetPosition = offsets[0];
|
||||||
|
@ -1694,8 +1694,6 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.ignoreIK = false;
|
|
||||||
|
|
||||||
var objectRotation = grabbedProperties.rotation;
|
var objectRotation = grabbedProperties.rotation;
|
||||||
this.offsetRotation = Quat.multiply(Quat.inverse(handRotation), objectRotation);
|
this.offsetRotation = Quat.multiply(Quat.inverse(handRotation), objectRotation);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue