microsoft / MixedReality-UXTools-Unreal

UX tools and components for developing Mixed Reality applications in UE4.
https://microsoft.github.io/MixedReality-UXTools-Unreal/
MIT License
316 stars 86 forks source link

Add "bool bFocusLockable" property in UUxtTouchableVolumeComponent. #20

Closed crssnky closed 3 years ago

crssnky commented 3 years ago
void UUxtTouchableVolumeComponent::OnFarPressed_Implementation(UUxtFarPointerComponent* Pointer)
{
    if (!FarPointerWeak.IsValid() && !bIsDisabled)
    {
        FarPointerWeak = Pointer;
        Pointer->SetFocusLocked(true);  // <-- I want to disable it.
    }
}

Wouldn't it be as shown below? (Off course, add bForcusLockable and its set/get as UUxtTouchableVolumeComponent's property.) "bForcusLockable" is a tentative name. Please give it a better name.

void UUxtTouchableVolumeComponent::OnFarPressed_Implementation(UUxtFarPointerComponent* Pointer)
{
    if (!FarPointerWeak.IsValid() && !bIsDisabled)
    {
        FarPointerWeak = Pointer;
        if(bForcusLockable){             // bForcusLockable is true in default.
            Pointer->SetFocusLocked(true); 
        } 
    }
}
valverl commented 3 years ago

Thanks for the feedback @crssnky . We currently lock the focus always to avoid interacting accidentally with other objects while the interaction with the touchable volume is in progress. Can you give us a bit of background on why you need to disable focus lock in your use case?

crssnky commented 3 years ago

I want that object react with focus. But not move it. Just react by focus.

This is implemented example. https://twitter.com/crosssoniky28/status/1343211451306049538

luis-valverde-ms commented 3 years ago

Thanks @crssnky . It took me a while to understand what was going on in the video but I think I get it now. I think it makes sense to change the touchable volume to allow that behavior. If you can share it and so we understand better the practical application, why does your touchable volume require that behavior?

crssnky commented 3 years ago

I'm sorry, that I'm not English speaker.

If you can share it and so we understand better the practical application, why does your touchable volume require that behavior?

It means below?

@crssnky wrote code for realize but, why @crssnky request to add `bFocusLockable`?

UX Tools plugin is not managed under the GitHub.(Like a Release Platform) So, I can't manage my branch incude desired change under the git.

When 'UX Tools' updated, I have to add desired change every time.

luis-valverde-ms commented 3 years ago

My bad, the way I wrote that was not very clear. What I meant was: what are you using the touchable volume for? I just want to understand in what situations it makes sense to have bFocusLockable set to false.

crssnky commented 3 years ago

what situations it makes sense to have bFocusLockable set to false.

Hand Iteraction focus an touchable volume without moving it. For example ↓ https://twitter.com/crosssoniky28/status/1348647313133035521

Objects can receive focus event at one grab action.

camccaf-msft commented 3 years ago

Hey @crssnky, this has been added in a826eb1fbcc089587ace9596f21c604ef39ab791 which you can get from our master branch!

crssnky commented 3 years ago

Thank you very much!