Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projected Gauss-Seidel (or PGS for short) based physics system, and a Weld Joint #1423

Open
Famous5000 opened this issue Aug 28, 2020 · 8 comments

Comments

@Famous5000
Copy link

Describe the project you are working on: I'm trying to work on a dynamic building project where you are allowed to build custom vehicles using lots of modules on one vehicle [and each module having its own health].

Describe the problem or limitation you are having in your project: The main issue I'm having is the fact that there's no real good "Weld" joint that forces 2 objects to stay perfectly combined with each other with 0 tearing.

Describe the feature/enhancement and how it helps to overcome the problem or limitation: The WELD joint would resolve this issue by combining the two collision meshes and locking them in place, but with the added ability to remove the joint to remove the combination of the colliders at the same time.

A PGS based solver would also fix this issue.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: Look at Roblox's PGS system. The weld joints perfectly weld 2 parts together with 0 movements between the two parts, and can even be chained a large number of times thanks to the PGS system.

If this enhancement will not be used often, can it be worked around with a few lines of script?: I'm not entirely sure on this one, however, a weld joint would allow two objects to stay together without both being set to static [or other weird physics limitations that happens when you parent a static object to a dynamic one]

Is there a reason why this should be core and not an add-on in the asset library?: This could totally just be an addon and I'd be fine with it; not everyone will be trying to weld two objects while keeping them separate for module-based health anyways.

@Famous5000
Copy link
Author

Adding to the "Reason why it should be core and not an add-on:" If it's even possible to do it as an addon, then I'd totally be fine with it. But considering this is adding a new freaking physics system, I doubt that it's easy to do in just an addon.

In addition: It'd give a compatibility layer for those who originally worked from Roblox to work on their own games completely from scratch in this engine.

@Calinou
Copy link
Member

Calinou commented Aug 28, 2020

If it's even possible to do it as an addon, then I'd totally be fine with it.

There are plans to expose some way for GDNative add-ons to expose new physics engines in the future.

@Famous5000
Copy link
Author

Alright, is there any potential we could get a new "Weld" joint before that so that I can make less janky builds?

@Calinou
Copy link
Member

Calinou commented Aug 28, 2020

@Famous5000 There are no plans to add new joint types in the near future, as the focus will mainly be on fixing what's in the current physics engines for 4.0 (#570).

@Famous5000 Famous5000 changed the title PGS (or Projected Gauss-Seidel for short) based physics system, and a Weld Joint Projected Gauss-Seidel (or PGS for short) based physics system, and a Weld Joint Aug 28, 2020
@Famous5000
Copy link
Author

Fixed title for clarity; the request remains the same.

@albinaask
Copy link

Not sure if I understood you correctly @Famous5000, but I have a project that faces a similar problem, the way I solved it was that I made each block or part extend collisionShape, and then added all of them as children to a rigid body derived node. Then all of them stay still, I'm able to track collisions, I can unhook any of the parts and just encase them with an other rigid body to make them "fall of". Is that approach something you can use in your scenario?

@Famous5000
Copy link
Author

Famous5000 commented Jan 24, 2021

Not sure if I understood you correctly @Famous5000, but I have a project that faces a similar problem, the way I solved it was that I made each block or part extend collisionShape, and then added all of them as children to a rigid body derived node. Then all of them stay still, I'm able to track collisions, I can unhook any of the parts and just encase them with an other rigid body to make them "fall of". Is that approach something you can use in your scenario?

That might actually work for my situation... I've stopped working on Godot since this issue, however, I might start it back up and try this again. I'll update you if this works.

@waleed177
Copy link

From reading ROBLOX documentation (https://create.roblox.com/docs/building-and-visuals/physics/assemblies) an assembly is "From a physics perspective, an assembly is considered a single rigid body, meaning no force can push or pull the connected parts from each other, and they will move as a single unit. All forces applied to a specific BasePart are applied to its assembly...", and when you weld two parts together, they become one assembly (usually). So thats how they stay perfected combined with no tearing, i dont think its because the PGS system. I would actually like something that does this in godot. But yeah you can just manually do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants