Skip to content

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

@gawinwong

Description

@gawinwong

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions