-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix gap in primitive circular meshes due to floating point error #94199
Fix gap in primitive circular meshes due to floating point error #94199
Conversation
Co-authored-by: A Thousand Ships <[email protected]>
Co-authored-by: A Thousand Ships <[email protected]>
Co-authored-by: A Thousand Ships <[email protected]>
It would be good to add some unit tests for this in |
I have never tried unit testing before, can you share some resources as to how I can implement it for this case? |
See this and you can look at the existing code to learn how it's used |
Co-authored-by: A Thousand Ships <[email protected]>
The Torus and Capsule still have gaps (since nothing was done to them) and the cylinder still has gaps in the rings of the caps. Additionally the approach taken is bit worrisome, as there is at least a theoretical possibility that vertices that should be different will be snapped to the same position if they're close enough (difference is less than epsilon). The sin and cos functions were fine, the problem was with the last vertex in the ring not matching the first; simpler approach would be to make the last iterations position zero with an if statement (whilst ensuring the UV:s remain correct). |
Hi, I also work on CSG, would it be ok to also test CSGMesh3D too? |
Superseded by: #100020 |
Fixes #93865
This is my first engine contribution besides docs therefore I have only fixed the sphere mesh for now as I am sure there will be changes needed in my implementation.
custom_sin
,custom_cos
,remove_negative_zero_vector3
andremove_negative_zero