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

Add debug render mesh for capsule and cylinder collider shapes. #125

Closed
wants to merge 4 commits into from

Conversation

nebkor
Copy link

@nebkor nebkor commented Feb 28, 2022

Without changing the way that the debug mesh's transform is calculated (just from scale), it's not
possible to accurately show a capsule's orientation in the debug view. So, just use a cuboid and
scale it along the capsule's AABB to get a reasonably accurate approximation.

I also did a minor tidy of the transform sync code.

Without changing the way that the debug mesh's transform is calculated (just from scale), it's not
possible to accurately show a capsule's orientation in the debug view. So, just use a cuboid and
scale it along the capsule's AABB to get a reasonably accurate approximation.

I also did a minor tidy of the transform sync code.
There are no cylinder shapes in 2d.
@nebkor nebkor changed the title Add debug render mesh for capsule collider shape. Add debug render mesh for capsule and cylinder collider shapes. Feb 28, 2022
transform.translation.y = tra.y * scale;
transform.translation.z = tra.z * scale;
transform.rotation = Quat::from_xyzw(rot.x, rot.y, rot.z, rot.w);
transform.translation = tra * scale;
Copy link
Author

Choose a reason for hiding this comment

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

I realize this is slightly out of scope for this PR.

@sebcrozet
Copy link
Member

Representing capsules/cylinders are cubes looks very misleading. Instead, we should generate new meshes for each capsule/cylinder, based on their dimensions, and use a scale of 1.

@sebcrozet
Copy link
Member

sebcrozet commented Apr 29, 2022

Thank you for this PR! Starting with #138, cylinders and capsules (as well as all the other possible shapes) are supported by the new debug-render.

@sebcrozet sebcrozet closed this Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants