dimforge / dimforge/parry

Dispatch traits aren't composable

Open
#8 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
867
Forks
157
Avg merge
7d 13h
Merged PRs (30d)
2

Description

When processing queries on a compound shape, `QueryDispatcher` methods must be invoked recursively. This makes it infeasible for custom shapes that occur inside compound shapes to be handled. Ideally downstream code could provide `chain`able `QueryDispatcher` impls that only handle the shapes they introduce and otherwise return `Unsupported`, but in that case a compound shape would fall through to the default dispatcher, which would recurse internally and fail to handle custom shapes it encounters. Similar issues affect any user-defined composite shapes. This could be fixed by adding a `root_dispatcher: &dyn QueryDispatcher` argument to every trait method. The same issue also affects `PersistentQueryDispatcher`.

I can bang this out, but it's a bunch of boilerplate updates and given that this logic was not preserved from ncollide I want to be sure it's welcome before proceeding.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.