Skip to content

hashCode for Vector3 etc do not work well #198

Closed
@robertmuth

Description

@robertmuth

If two vectors are close to zero they will map to "0" in the current hashCode implementation.
A better approach would be something like this:

int hashVector3(VM.Vector3 v) {
int h = 0;
for (int i in v.storage.buffer.asInt32List()) {
h ^= i;
}
return h;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions