UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG]: screen position out of view frustum (screen pos 0.000000, -nan)

Open gawinwong opened this issue 1 year ago • 2 comments

Package version

3.1.0-exp.6

Environment

* OS: Ubuntu 18.04
* Unity version: 2020.3.3f1
* Graphics API: vulkan
* Browser: chrome 115.0.5790.102

Steps To Reproduce

  1. Use broadcast sample, start webapp
  2. Sometime unity editor will occur this error message"screen position out of view frustum (screen pos 0.000000, -nan)"

Current Behavior

No response

Expected Behavior

No response

Anything else?

After debug, I have found that this error is caused by the below code.

# Runtime/Scripts/InputPositionCorrector.cs
unsafe void PointerMap(StateEvent* data, InputDevice device)
        {
            switch (device)
            {
                case Mouse mouse:
                    MouseState* mouseState = (MouseState*)data->state;
                    mouseState->position = Map(mouseState->position, inputRegion, outputRegion);
                    break;
                case Touchscreen touch:
                    // todo(kazuki): multi touch is not supported yet.
                    TouchState* touchState = (TouchState*)data->state;
                    touchState->position = Map(touchState->position, inputRegion, outputRegion);
                    break;
            }
        }

The mouseState->position sometime will be (0, NAN)

Hope to fix in newer version, thanks

gawinwong avatar Jul 27 '23 08:07 gawinwong

@gawinwong Thank you, let me check.

karasusan avatar Aug 01 '23 05:08 karasusan