Skip to content
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

Adding Collider::round_cuboid #300

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Adding Collider::round_cuboid #300

merged 1 commit into from
Jan 16, 2024

Conversation

kav
Copy link
Contributor

@kav kav commented Jan 16, 2024

Objective

Looking through the code it appears we have a round cuboid available from Parry but are missing the function to create it. Rounded cuboids are handy for several things though in my case it's providing a smooth tunnel edge for couched players entering tunnels and also offering slight "just missed it" jump handling.

Solution

I reviewed the cubiod functions and SharedShapes to determine the round_cubiod pattern. Not sure if I've missed some things and happy to accept any changes or add tests and docs as needed.

Changelog

Added
2d: Collider::round_cuboid(x_length: Scalar, y_length: Scalar, border_radius: Scalar)
3d: Collider::round_cuboid(x_length: Scalar, y_length: Scalar, z_length: Scalar, border_radius: Scalar)

@Jondolf Jondolf added C-Enhancement New feature or request A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality labels Jan 16, 2024
@kav kav changed the title Draft: Adding Collider::round_cuboid Adding Collider::round_cuboid Jan 16, 2024
Copy link
Owner

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Jondolf Jondolf merged commit 0311c53 into Jondolf:main Jan 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants