view
Tweet
hifi: #21200 $200 - Transfer from far-grab to near grab when close

Right now we have two kinds of 'grabs' the far-grab and the near-grab. The far-grab can be confusing because often your intent is to pull an object to yourself so that you can hold it. But a far-grabbed object does not move in the same way, so you can be confused as to which way you are holding it when close, and be unable to rotate or throw it.

Implement this change:

During a far grab, if the object is brought close enough to be near-grabbed, transfer from the far grab to a near grab. This will allow you, for example, to far grab a basketball, bring it to you, and then throw it normally.

At the start of the near-grab, play a haptic pulse, the same as happens when the hand passes into a grabbable object.

If the object is capable of being equipped, transfer from far-grab to an equipped state.

Comments & Activity

  • 2 mnths, 22 days ago

    #21200 created by PhilipRosedale Status set to Bidding.

  • 1 mnth, 24 days ago

    A bid was placed on #21200

  • 1 mnth, 24 days ago

    volansystech added a fee of $200 to #21200

  • 1 mnth, 24 days ago

    themelissabrown deleted a fee from volansystech on #21200

  • 1 mnth, 24 days ago

    #21200 updated by themelissabrown Changes: Assignee changed.

  • 1 mnth, 24 days ago

    themelissabrown accepted 200.00 from volansystech on #21200 Status set to In Progress.

  • @volansystech checking in on this project as well
  • @themelissabrown ,
    We are able to convert far-grab into near-grab when entity is closer to Avatar's hand. We can move "grabbedEntity" as well.
    We are observing that, when we released trigger "grabbedEntity" moves on to the position from where we converted far-grab into near-grab. Then "grabbedEntity" stays into that position for a few seconds (hanging into mid of air) before dropping down automatically. Is this expected behavior?

    We debug above behavior deeply and found function call from handControllerGrab.js : this.callEntityMethodOnGrabbed -> EntityScriptingInterface.cpp (callEntityMethod) method. We didn't find trace to particular methods which passed from JS. Example. callEntityMethodOnGrabbed("releaseGrab"); -> No trace to "releaseGrab" specifically. Will you please help us to identify further flow?

    Do we have any kind of architecture document or block diagram or flow-chart of our system? Any reference for state management? or reference of state management for grab operations / events specifically?
  • @themelissabrown Just FYI: we are using Oculus Rift as a hardware & testing purpose.
  • great! One of our internal developers will be commenting on this shortly.
  • @volansystech for us to give you the right information, we'll need to check out what you've got. Can you submit a PR with your code thus far so I can assign it to an internal developer and get you answers?
  • @themelissabrown, We just committed our initial code into repo. Please refer: https://github.com/volansystech/hifi/commit/e0b08a5e4e108500f2fbb3f62f70cf846ffee61c . We are awaiting response on above comment.
  • @themelissabrown,
    We observed that when we do distance grabbing, distance between object and hand is not proper for different hand potions.
    For example, while doing distance holding with hand positioned at chest level, distance between object and hand does gets lesser than 1.0
    If we perform same action with hand at hip level, we never able to get distance below 1.0. Although UI does shows object is very near to hand (sometimes hand goes within the object but still distance is greater than 1.0) Either we are calculating something wrong or system is not behaving as intended or UI is misleading.

    We are calculating distance from following piece of code,

    var controllerLocation = getControllerWorldLocation(this.handToController(), true);
    var handPosition = controllerLocation.position;
    var distanceToObjectFromHand = Vec3.length(Vec3.subtract(handPosition, this.currentObjectPosition));

    This is impacting our far-grab to near-grab conversion's accuracy. Let us know your thoughts on this.
  • @volansystech: The function below, found in handControllerGrab, is what I think you want to test whether the object is grabbable:

    this.entityIsNearGrabbable = function(entityID, handPosition, maxDistance) {

    if (!this.entityIsCloneable(entityID) && !this.entityIsGrabbable(entityID)) {
    return false;
    }

    var props = entityPropertiesCache.getProps(entityID);
    var distance = Vec3.distance(props.position, handPosition);
    var debug = (WANT_DEBUG_SEARCH_NAME && props.name === WANT_DEBUG_SEARCH_NAME);

    if (distance > maxDistance) {
    // too far away, don't grab
    if (debug) {
    print(" grab is skipping '" + props.name + "': too far away.");
    }
    return false;
    }

    return true;
    };
  • @PhilipRosedale Thanks for suggestion, but we checked same thing before. Our queries are,

    1. Once we converts far-grab into near-grab "grabbedEntity" stays into that position for a few seconds (hanging into mid of air) before dropping down automatically. Is this expected behaviour?

    2. Need some guidance over EntityScriptingInterface.cpp -> callEntityMethod for various states.

    3. Any kind of architecture document or block diagram or flow-chart of our system? Any reference for state management?

    4. while doing distance holding with hand positioned at chest level, distance between object and hand does gets lesser than 1.0
    If we perform same action with hand at hip level, we never able to get distance below 1.0. Although UI does shows object is very near to hand (sometimes hand goes within the object but still distance is greater than 1.0)
  • @PhilipRosedale & @themelissabrown

    We just resolved bug from initial commit for "grabbedEntity" hanging into mid-air.

    As we already mentioned in above comment distance between currentObjectPosition and Avatar's hand is not precise / accurate. In some scenarios it does gives value lesser than 1.0 , when it does we can convert far-grab into near-grab. When it don't we cannot. Please refer above comment for more details.

    Now, we can safely say that conversion of far-grab into near-grab is done. Refer: https://github.com/volansystech/hifi/commit/99af493ac8bc221e559713e87933d2b4c44f243f
  • Great! please submit a PR and we'll get this into review!
  • 27 days, 9 hrs ago

    #21200 updated by themelissabrown Changes: Status set to Done.

Labels Saved!

Bids

Login to bid
Who Amount Done in ...
*name hidden*$ ***2 hrs