bepu / bepuphysics2

Pure C# 3D real time physics simulation library, now with a higher version number.
Apache License 2.0
2.25k stars 261 forks source link

Does this mean that when end_point0 =new EdgeEndpoints(){A=0,B=3}, end_point1 =new EdgeEndpoints(){A=1,B=2}, their hash values are equal #260

Closed zyxia closed 1 year ago

zyxia commented 1 year ago

https://github.com/bepu/bepuphysics2/blob/d77ee1a33268c4439b8d1d62b5dd873724833ced/BepuPhysics/Collidables/ConvexHullHelper.cs#L414

zyxia commented 1 year ago

When the hash values are equal, doesn't it affect the index of the Dictionary?

RossNordby commented 1 year ago

Yes, but it won't break the dictionary- the hash value is allowed to collide with other entries. It's just not ideal.

This hash could be improved, I just didn't bother at the time.