-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add Squircle primitive #13652
base: main
Are you sure you want to change the base?
Add Squircle primitive #13652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are great, I quite like the code implementation, and I agree with your choice of gizmo drawing technique, cursed as it is.
My one concern centers around utility. This is a UI-centric addition, but there's no way to use this in UIs currently, and it's not clear how users would do so. Are there other game dev uses to consider? Should we merge this anyways and tackle adding rounded corner support using squircles in a follow-up?
Yeah, I would prefer that to be in a follow up, since that would be a completely new solution touching at least one more crate |
Co-authored-by: Alice Cecile <[email protected]>
@lynn-lumen looks like this needs some love with the recent changes on main. |
Is there a variation of this type of shape that would have "symmetrical curvature" even when width and height are not equal? To crudely illustrate: https://www.desmos.com/calculator/r4mzfslt8m As-is, this seems less useful than it could be. |
Bumping to controversial: I'm not actually sold on how useful this is. Maybe the UI designers know something I don't, but this doesn't seem to be a meaningful improvement over rounded corners. |
There seems to be an issue with |
Objective
Solution
Squircle
primitive tobevy_math
. The chosen squircle is based on the superellipse..resolution()
on the builderAdditional information
The gizmos implementation may seem overcomplicated, but the following images may clarify why an implementation like this is needed:
![superellipses](https://private-user-images.githubusercontent.com/62256001/336157503-aef9925a-6afa-4902-95f6-4ab5624fe923.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTAwNjUsIm5iZiI6MTczOTI0OTc2NSwicGF0aCI6Ii82MjI1NjAwMS8zMzYxNTc1MDMtYWVmOTkyNWEtNmFmYS00OTAyLTk1ZjYtNGFiNTYyNGZlOTIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA0NTYwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYxYjY0Njc1OWFlNmIxNWRiZTQxMGMxNDU3ZWM2MDk3YzIxOTc3NmYwNGZiNzU5MWM4Y2UxNTUxNTQ2MDJkODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ERA8k8IITAPBM_wecwFUPOSnrKJyBvCahqhuEF7Sv8k)