Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid coords for TryGetPosition and TryGetRotation #1290

Closed
hridpath opened this issue Nov 2, 2017 · 8 comments
Closed

Invalid coords for TryGetPosition and TryGetRotation #1290

hridpath opened this issue Nov 2, 2017 · 8 comments

Comments

@hridpath
Copy link

hridpath commented Nov 2, 2017

In the Unity.XR.WSA.Input.InteractionSourcePose the TryGet functions can return a true value with corrdinates in the results having a NaN value. I have created a Bug Report to Unity and waiting on the results. This may be intentional on their part so inorder to prevent errors when using the output of these methods, A NaN check should be done prior to using the values.

As a Temporary fix the following code can be used allong with these TryGet functions.
Here is a snippit of code to fix this in teh MotionControllerVisualizer.cs
mcv_validpos_rot

@StephenHodgson StephenHodgson changed the title Current Version of Unity 2017.2.0f3-MRTP3 will return invalid coords for TryGetPosition and TryGetRotation Invalid coords for TryGetPosition and TryGetRotation Nov 2, 2017
@StephenHodgson
Copy link
Contributor

I think there's a simpler way to check if the value is valid at all, including infinity

@hridpath
Copy link
Author

hridpath commented Nov 2, 2017

TryParse by converting the value ToSting() would cover the infinity, but this can be very expensive in an Update. @StephenHodgson Do you think that Infinity would be invalid in this case with the Motion Controller?

@StephenHodgson
Copy link
Contributor

Why wouldn't float.IsInfinity(newPosition.y) not work?

@keveleigh
Copy link
Contributor

keveleigh commented Nov 3, 2017

Why do we need to check IsInfinity?

@StephenHodgson
Copy link
Contributor

Who know's. We're getting NaNs so there is the possibility

@hridpath
Copy link
Author

hridpath commented Nov 3, 2017

The IsInfinity check can be included in the return expression. Would you consider Infinity an invalid value to set a Position or Rotation??

@StephenHodgson
Copy link
Contributor

@hridpath were you going to submit a PR for this?

@keveleigh
Copy link
Contributor

Looks like GitHub didn't automatically close these issues when merged into master. I'll close these manually and look into why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants