Giter Club home page Giter Club logo

Comments (2)

neachdainn avatar neachdainn commented on June 1, 2024

I investigated having nphysics define its own BroadPhasePairFilter trait but almost 100% of the collision logic happens in ncollide (unsurprisingly). So it looks like this will have to be a change within ncollide.


I suspect the best approach would be to modify the BroadPhasePairFilter to the following:

pub trait BroadPhasePairFilter<N: RealField, Object, Handle, Set>: Any  + Send + Sync {
    fn is_pair_valid(&self, b1: &Object, b2: &Object, h1: Handle, h2: Handle, set: &Set) -> bool;
}

where Set becomes the BodySet in nphysics. This will require a change at every step between nphysics and ncollide's src/pipeline/glue/update.rs, so it's a fairly sizable change. I'll wait to start working on this until I get input.

from nphysics.

neachdainn avatar neachdainn commented on June 1, 2024

Alternatives discussed on Discord:

  • Using an associated type with a default and implementing a default fn is_pair_valid_in_set.
  • Creating a new trait BroadPhasePairSetFilter that is auto-implemented for (or auto-implements) BroadPhasePairFilter

from nphysics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.