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

Shouldn't PhysicsMaterial properties correspond to individual shapes rather than the body? #25254

Closed
Tracked by #45334 ...
twilson90 opened this issue Jan 23, 2019 · 11 comments

Comments

@twilson90
Copy link

Am I missing something here?
It seems you can't have a single body consisting of multiple shapes with multiple physical properties.
For instance, if I wanted to create a somewhat realistic rubber tipped pencil in a physics simulator, the rubber tip would need to have a bouncier, rougher quality than the rest of the pencil.
It appears however that this is not possible without creating 2 bodies and putting a rigid joint between them, it doesn't seem right.

In Unity and other physics engines I've worked with, the Shape/Collider has the PhysicsMaterial equivalent properties, not the body.

Apologies if this is the wrong venue for this type of discussion. I asked about this on the community forum a while ago but got no replies: https://godotengine.org/qa/28594/rigid-compound-body-consisting-multiple-physical-properties

@akien-mga
Copy link
Member

CC @AndreaCatania @reduz

@eon-s
Copy link
Contributor

eon-s commented Jan 23, 2019

I guess it could make sense except that shapes are not used on bodies only.

And is not your rubbed tipped pencil consisting on the solid and the bouncy part? pinned by a joint?

@twilson90
Copy link
Author

If I wanted the rubber part to detach when hit with force then I might consider using a joint, but otherwise a joint doesn't seem appropriate.
It makes perfect sense to me that you'd find the physical properties on an individual collider/shape, than the all encompassing body.

@reduz
Copy link
Member

reduz commented Jan 23, 2019 via email

@reduz
Copy link
Member

reduz commented Jan 23, 2019 via email

@akien-mga akien-mga added this to the 4.0 milestone Jan 23, 2019
@AndreaCatania
Copy link
Contributor

I want to highlight that, in other engines (like UE4) when you use a compound body, internally the engine add many bodies with only one shape.

In Godot you have the possibility to have many shape under the same body and you are noticing this "problem" because Godot give you more freedom. So to solve it you can just simply add more bodies with only one shape.

(Side note, is better to not have 1 body with hundreds shapes to improve the performance).

However is possible to add this feature at cost of work time and engine performance.

@AndreaCatania
Copy link
Contributor

If I wanted the rubber part to detach when hit with force then I might consider using a joint, but otherwise a joint doesn't seem appropriate.
It makes perfect sense to me that you'd find the physical properties on an individual collider/shape, than the all encompassing body.

In this case you are forced to use a joint, or even better spawn the rigid body when the part breaks

@twilson90
Copy link
Author

However is possible to add this feature at cost of work time and engine performance.

Compound body nodes seems the way to go then.

I wonder if this works in Bullet, though..

I was watching a youtube video earlier demonstrating the Bullet physics engine in Blender, in which a compound option is shown, so it's definitely possible and probably not too difficult to implement:

https://www.youtube.com/watch?v=BGAwRKPlpCw

@AndreaCatania
Copy link
Contributor

It doesn't allow to add custom friction per shape

@akien-mga
Copy link
Member

Not much new here in the past 3 years, though this is being tracked as a potential future enhancement in the above two tracker issues.

In the meantime we've moved feature proposals to https://github.com/godotengine/godot-proposals/issues, I think it would be worth it to do the same for this proposal so that users interested in this suggestion can find it and indicate their support/provide feedback/implement it.

@rburing
Copy link
Member

rburing commented Feb 22, 2023

Please open a proposal for this feature request.

@rburing rburing closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2023
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

6 participants