Skip to content

Problem with HashMaps and Resources #6818

Answered by james7132
IsaacGaches asked this question in Q&A
Discussion options

You must be logged in to vote

Hash requires Eq to be implemented on the type. Vec2 does not implement it since f32 does not implement it since NaN exists and breaks the contract of Eq. If you're doing a chunk map, you could use UVec2, which uses integers instead of f32, and it implements both Eq and Hash.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@IsaacGaches
Comment options

@james7132
Comment options

@IsaacGaches
Comment options

@james7132
Comment options

Answer selected by james7132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants