mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 23:55:24 +02:00
Merge pull request #8758 from hyperlogic/bug-fix/allow-ignoreik-false
allow equipped object to follow hand and not controller
This commit is contained in:
commit
16af14d1f6
2 changed files with 7 additions and 6 deletions
|
@ -26,7 +26,7 @@ var WANT_DEBUG = false;
|
|||
var WANT_DEBUG_STATE = false;
|
||||
var WANT_DEBUG_SEARCH_NAME = null;
|
||||
|
||||
var FORCE_IGNORE_IK = true;
|
||||
var FORCE_IGNORE_IK = false;
|
||||
var SHOW_GRAB_POINT_SPHERE = true;
|
||||
|
||||
//
|
||||
|
@ -1382,10 +1382,11 @@ function MyController(hand) {
|
|||
this.chooseBestEquipHotspot = function(candidateEntities) {
|
||||
var DISTANCE = 0;
|
||||
var equippableHotspots = this.chooseNearEquipHotspots(candidateEntities, DISTANCE);
|
||||
var _this = this;
|
||||
if (equippableHotspots.length > 0) {
|
||||
// sort by distance
|
||||
equippableHotspots.sort(function(a, b) {
|
||||
var handControllerLocation = getControllerWorldLocation(this.handToController(), true);
|
||||
var handControllerLocation = getControllerWorldLocation(_this.handToController(), true);
|
||||
var aDistance = Vec3.distance(a.worldPosition, handControllerLocation.position);
|
||||
var bDistance = Vec3.distance(b.worldPosition, handControllerLocation.position);
|
||||
return aDistance - bDistance;
|
||||
|
@ -1896,7 +1897,7 @@ function MyController(hand) {
|
|||
if (FORCE_IGNORE_IK) {
|
||||
this.ignoreIK = true;
|
||||
} else {
|
||||
this.ignoreIK = grabbableData.ignoreIK ? grabbableData.ignoreIK : false;
|
||||
this.ignoreIK = (grabbableData.ignoreIK !== undefined) ? grabbableData.ignoreIK : true;
|
||||
}
|
||||
|
||||
var handRotation;
|
||||
|
|
|
@ -830,7 +830,7 @@ function loaded() {
|
|||
|
||||
elGrabbable.checked = properties.dynamic;
|
||||
elWantsTrigger.checked = false;
|
||||
elIgnoreIK.checked = false;
|
||||
elIgnoreIK.checked = true;
|
||||
var parsedUserData = {}
|
||||
try {
|
||||
parsedUserData = JSON.parse(properties.userData);
|
||||
|
@ -1143,7 +1143,7 @@ function loaded() {
|
|||
userDataChanger("grabbableKey", "wantsTrigger", elWantsTrigger, elUserData, false);
|
||||
});
|
||||
elIgnoreIK.addEventListener('change', function() {
|
||||
userDataChanger("grabbableKey", "ignoreIK", elIgnoreIK, elUserData, false);
|
||||
userDataChanger("grabbableKey", "ignoreIK", elIgnoreIK, elUserData, true);
|
||||
});
|
||||
|
||||
elCollisionSoundURL.addEventListener('change', createEmitTextPropertyUpdateFunction('collisionSoundURL'));
|
||||
|
@ -1596,4 +1596,4 @@ function loaded() {
|
|||
document.addEventListener("contextmenu", function(event) {
|
||||
event.preventDefault();
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue