Closed FlorentP42 closed 1 year ago
This is extremely similar in scope to #144, is there a use-case here that does not fit in that request?
That sounds perfect as long as the MergeBody(bodyA, bodyB)
part is implemented, we all want to be able to stick existing bodies as well, not only newly spawned ones ;)
So yeah I don't know if "close as duplicate" is a thing in GitHub but I guess we could put a mention to this ticket near your MergeBody(bodyA, bodyB)
for more detail on that use case and then close this one.
Is your feature request related to a problem (if not, explain why you think this feature should be added)? Please describe.
So what I am looking for is a way to weld perfectly two shapes together, as if they were spawned as part of the same body: so they will only separate if the voxels making contact between them are all broken.
Describe the solution you'd like
I was thinking about some functions like:
AddShapeToBody(body, shape)
: Add a shape to a given body and make them behave as a single entity (as long as the shape has a contact point with any obj the shapes in the designated body)MergeBodies(body1, body2)
: Merge tow bodies into one, making their shapes part of the same body.Weld(shape1, shape2)
: Somehow make those shapes perfectly stick together, adding them to a same parent body or something.I am aware most of these solution may lead to issues like having orphan bodies with no more shapes in them, hopefully this is not critical, or maybe they could be cleanedup automatically somehow.
Describe alternatives you've considered
I was able to "stick"two shapes together using a "ball" joint with maximal resistence, sadly it is still possible for the shape to rotate relatively to each other if too much force is applied on them. Also this solution does not work well to make sure both shapes will stick until all of the voxels making contact between them are broken. (yes making one joint per voxel in contact could work but that sounds pretty suboptimal and potentially laggy).
I am also aware of the existance of the
Constrain*()
functions, but I believe this does not allow to separate the shapes automatically when voxels between them have been broken. And trying to compute the list of all voxels touching between two shapes from scripts sounds to me like a potentially laggy process...Additional context
The Nythroglycerin/Bomb seems to work a bit like what I want, so I'm curious how this is done in the background. Even if I can't confirm that the shape would stick perfectly until all the voxels touching its base will be destroyed, as said voxels will explode if you break one of them for Nytro and are unbreakable for Bomb :p