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

Check validity of transform data #43

Merged
merged 3 commits into from
Dec 21, 2020

Conversation

johnshaughnessy
Copy link

@johnshaughnessy johnshaughnessy commented Nov 17, 2020

Fixes the common / immediate impact of Hubs-Foundation/hubs#3355

If we are concerned about this for other networked properties, we should build validation into all of them. This only addresses position/quaternion/scale updates.

We should make sure this does not slow down the client.

!isNaN(v.z) &&
v.x !== null &&
v.y !== null &&
v.z !== null
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL isNaN(null) is false. I forgot how fun this language can be...

Number.isNaN(null)
> false
Number.parseInt(null)
> NaN
typeof(null)
> "object"
typeof(NaN)
> "number"

Copy link

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I also tested performance with 20 bots and these additional checks did not add much of an overhead at all.

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