Open Virusthe opened 3 years ago
This is usually called "articulated rigid body" dynamics in my experience. Maybe include that in the title for folks who recognize the term.
As a sidenote, I'm working on a 2D SoftBody implementation right now. I won't create a proposal for it until after it's finished and tested, though.
@Virusthe if you ever want to try implementing articulated rigid bodies yourself, this book has an excellent treatment of the topic, and all the details of its implementation: https://www.cs.clemson.edu/savage/pba/
That said, I can't remember if they describe it on terms of a PID control, step-and-project, or direct enforcement. I've actually implemented this before, and I'll post a picture later
@Virusthe see if this proposal accomplishes what you want:
Some of my examples logic and how I think this could be implmented might be wrong but I will need to check again
Describe the project you are working on
A 2d fully physics-based combat game with joints.
Describe the problem or limitation you are having in your project
I can't get physics-based joints to work.
Describe the feature / enhancement and how it helps to overcome the problem or limitation**
A new physics/rigid joint2D node that will allow for things such as physics-based animations, or even a softbody2d type node. Another way of implementing this would be to extend the rigid body to add "connections"
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams**
Description: This node is similar to the nodes that inherit joint2D is used for bone style rotation specifically for connecting two rigid bodies or rigid body and static body Implantation summery -the "underling" body rotation point is the "master" body's position. light blue circle = central "master" rigid body (see Properties List for more info)
Examples of this The green boxes are collision shapes and in this situation the connected rigidbodys should stay togetter at the same lenght/"share mass"
Rotation weight the force is applied with a collision. body 2 = master body 1 = underling 100F is added to body 2 for ex. 1-3, 4 has 100F added to body 1
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library? I think this will be useful for users doing 2d physics
Extra thing -I think this could also be used to make a softbody2d node too if one were to add some sprite deformations -Basically, with this node, you would draw a polygon2d/shape2d and using the "soft points property" you can set the number of rigid body points and with the hardness property 0 - 1 you can get the hardness of the object. The soft body "pushes" the same way a "body moves" with animation player thing" -points which are rigid bodies should be distributed equally among the lines of the shape -properties -polygon2D/shape2D -hardness 0 to 1 - (0 would make the body drop into a pile of lines - 1 would make the body unbendable) -soft points -edit individual points -mass (this gets divided equally by default among all the points unless a point is edited by the edit individual points thing. Example (no image yet)