GithubHelp home page GithubHelp logo

Comments (6)

jjimenezg93 avatar jjimenezg93 commented on May 19, 2024 2

Hi @TresSims,

I think that this is the behaviour that you're looking for:

grab-target-test

The cube starts as magenta and grabbing it with a single hand allows movement but doesn't change the color. When you grab with two hands, its color changes to yellow and transformations are disabled (I think that this would be equivalent to your "unfold"). Then it goes back to red whenever interaction ends (fold back?).

This is the Blueprint that I used:

grab-target-test-bp

Pleae note the configuration of the UxtGenericManipulator, which allows both one and two hand interactions but disables transformation with two hands, so you can add your custom logic for it. The call to GetSecondaryGrabPointer will only return true when there are 2 pointers, so it's a slightly simpler trick than getting the array of pointers and taking its length, but that should work exactly the same.

You probably want some more specific conditions for OnEndGrab, for example keeping a counter of pointers that were grabbing and doing one thing when 2 were released and something different when only 1 is. I think that the component should give you enough flexibility for this kind of checks.

An alternative would be implementing your own manipulator in C++, potentially inheriting from UxtManipulatorComponentBase.

Please let us know if this works for you.

Thank you!

from mixedreality-uxtools-unreal.

TresSims avatar TresSims commented on May 19, 2024 1

Hi @jjimenezg93

Thanks for your response! I'm more than happy to provide any information I can to help.

This screenshot shows the setup of my blueprint, including the event
image

This is currently happening using both the virtual hands in the play in editor experience as well as after the application is built and run on a Hololens 2 device.

I also tried modifying that file to use a counter of how many times the "On Begin Grab" and "On End Grab" events fire for the one handed interaction mode to keep track of how many pointers are interacting with the component at once, but both events were firing seemingly simultaneously, meaning my counter never registered any pointers interacting with the component.
image

I am happy to share any further information I can but am not sure what else would be relevant, so please let me know!

Thanks!

from mixedreality-uxtools-unreal.

jjimenezg93 avatar jjimenezg93 commented on May 19, 2024 1

Hi again @TresSims,

I've realised that you have both a UxtGrabTarget and a UxtGenericManipulator. The latter inherits from the former and, with this setup, they're both receiving an OnBeginGrab event and calling NotifyManipulationStarted (from here). This function tells other manipulator components in the actor that they have to release their manipulation because a new one started. I replicated a simplified version of your setup and this is what's causing the issue.

If all you need is basic manipulation behaviour that allows you to grab your actor around, you could remove the UxtGrabTarget. Then, instead of subscribing to the OnBeginGrab/OnEndGrab events of that component, you could subscribe to the same events in the UxtGenericManipulator.

This should be enough unless you specifically need to have both grab targets acting on different primitives in the actor simultaneously. That's not supported at the moment, so could you please confirm that this is not your intention?

Please let us know if removing that component fixes your issue and the resulting setup fits your needs.

Thank you!

from mixedreality-uxtools-unreal.

TresSims avatar TresSims commented on May 19, 2024 1

That will work perfectly, thank you so much for your support!

from mixedreality-uxtools-unreal.

jjimenezg93 avatar jjimenezg93 commented on May 19, 2024

Hi @TresSims !

I'll look into this and get back to you during the next few days.

Please consider sharing further details or a screenshot of the blueprint if that's possible, as the more details the easier it'll be for me to reproduce your issue.

Thanks!

from mixedreality-uxtools-unreal.

TresSims avatar TresSims commented on May 19, 2024

Thanks for your help @jjimenezg93 ,

I do have a reason for having both. The UxtGenericManipulator I am using as you have described for the basic manipulation behavior, but I want separate logic to trigger when the object is grabbed with two hands, so I added the UxtGrabTarget that would only trigger those events when it is interacted with using both hands.

The idea is that when you are grabbing the object with one hand, you can move it around and manipulate it as you would expect, but when you grab the object with two hands, it "unfolds" into something else.

This was something that I had working in what must have been a previous release, however I can see now that I have set this up in a weird way, is there a more recommended way to implement this type of functionality?

Thanks again for you help!

from mixedreality-uxtools-unreal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.