Code Monkey home page Code Monkey logo

Comments (2)

Jondolf avatar Jondolf commented on May 26, 2024

ExternalForceParent feels too niche for me. There are other ways to achieve the desired behavior, and I don't like introducing a ton of new yet similar components for something so specific.

apply_force_at_point is given the local center of mass. So yes, it should take it into account, assuming the given center of mass is correct.

In your case, I would either manually implement the logic that accumulates the child forces to the parent's ExternalForce, taking into account their offsets, or use joints. You could use a DistanceJoint or some other joint type to align the thrusters etc. to specific offsets (with local anchor points) relative to the actual ship. This way, applying forces on the thrusters (and other connected bodies) should automatically apply forces and torques to the ship correctly.

from bevy_xpbd.

ActuallyHappening avatar ActuallyHappening commented on May 26, 2024

For my specific use case, I manually implemented a solution here: https://github.com/ActuallyHappening/bevy_xpbd3d_parenting
It does rely on clear_forces_and_impulses being public, which is the reason for #257
It solves this problem by introducing a new component: InternalForce. I believe a better approach would be to add a second flag to ExternalForce (and ExternalTorque if desired, although I only really care about forces for the moment) .internal, which a dedicated system would propagate to parents as done in my repo link above.

from bevy_xpbd.

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.