Giter VIP home page Giter VIP logo

Comments (4)

stephengold avatar stephengold commented on May 9, 2024

Thanks for bringing this to my attention.

Like many physics engines, Bullet includes performance optimizations that cache contacts from one time step to the next. While I haven't stepped through the code, I suspect that's what happened in your example. Perhaps there is a mechanism to clear cached contacts, or if not perhaps I can add one. But maybe the callback happens too late to avoid contact forces. I'll investigate further.

As for detecting the collision earlier, Bullet includes a mechanism to report axis-aligned bounding-box (AABB) overlaps during broadphase. Not all AABB overlaps turn into actual collisions, but I'm pretty sure every collision is preceded by an overlap. Said mechanism can be used to disable collisions dynamically. The mechanism isn't quite exposed in Libbulletjme. All that would be needed would be to make the notifyCollisionGroupListeners_native() method public or add a listener mechanism to it. I suspect that's the best solution to your (hypothetical?) problem. Look for something in the next release...

from libbulletjme.

stephengold avatar stephengold commented on May 9, 2024

@JBraig I added a simple mechanism to disable collisions between particular objects on the fly. Please take a look and tell me whether you think the mechanism will meet your needs: f7cfb87

from libbulletjme.

JBraig avatar JBraig commented on May 9, 2024

That should be a sufficient solution for my needs, thanks a bunch!

from libbulletjme.

stephengold avatar stephengold commented on May 9, 2024

That should be a sufficient solution for my needs, thanks a bunch!

Glad to hear it! The "simple mechanism" of needsCollision() will be included in the v12.8.0 release, which should be published to MavenCentral later today.

But maybe the callback happens too late to avoid contact forces. I'll investigate further.

I investigated this question. For the record, the callback is invoked during space.distributeEvents(), not during space.update(). That's definitely too late to avoid contact forces. I'm working on an interface to obtain collision events sooner, equivalent to gContactStartedCallback and gContactProcessedCallback in Bullet. It's partially implemented in v12.8.0 .

from libbulletjme.

Related Issues (19)

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.