Conversation
Jondolf
added a commit
to avianphysics/avian
that referenced
this pull request
Jun 18, 2025
# Objective Parry added support for a cool new [`Voxels` shape](dimforge/parry#336) for efficient voxelized geometry without ghost collision problems caused by internal edges. We should add support for this too! ## Solution - Update to Parry 0.21 - Add `Collider::shape_mut` - Add `Collider::voxels` - Add `Collider::voxels_from_points` - Add `Collider::voxelized_polyline` (2D) - Add `Collider::voxelized_trimesh` (3D) - Add `Collider::voxelized_trimesh_from_mesh` (3D) - Add `Collider::voxelized_convex_decomposition` - Add `Collider::voxelized_convex_decomposition_with_config` - Add `Collider::voxelized_convex_decomposition_from_mesh` (3D) - Add `ColliderConstructor::Voxels` - Add `ColliderConstructor::VoxelizedPolyline` - Add `ColliderConstructor::VoxelizedTrimesh` - Add `ColliderConstructor::VoxelizedTrimeshFromMesh` The update to Parry 0.21 also made `SharedShape::trimesh` and `SharedShape::trimesh_with_flags` fallible. To support this, `Collider::trimesh` and `Collider::trimesh_with_config` now panic for degenerate input, but there are also `Collider::try_trimesh` and `Collider::try_trimesh_with_config` versions that return a `Result`. --- ## Migration Guide `Collider::trimesh` and `Collider::trimesh_with_config` can now panic for degenerate input. Use `Collider::try_trimesh` and `Collider::try_trimesh_with_config` to instead get a `Result` and handle error cases manually.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PRs adds partial support of a new
Voxelsshape. This shape type is designed to handle efficiently, and without "internal edges" artifacts, collision detection with objects defined as a set of voxels. EachVoxelsshape is free to have their own voxel size; and can be rotated/translated arbitrarily as a whole. The voxel size can be different along each axis (i.e. it can be a rectangle instead of just a cube).This feature is still experimental as it is missing some elements. The following is supported:
Notable features that are currently missing are: