Allow grabbed objects to override the ignoreIK = true default.

They can do this by adding the following to their userData.

    grabbableKey: {
        ignoreIK: false
    }

When this is present and false, the object will follow the hand joint, otherwise it will follow the hand controller.
This commit is contained in:
Anthony J. Thibault 2016-10-07 14:50:00 -07:00
parent 0c2ebc27cb
commit 7c7a9055d1

View file

@ -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;
//
@ -1901,7 +1901,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;