What I need:
Find the set of all parts that have been welded together, starting from any part P
in that weld configuration.
Bruteforce solution:
workspace
hierarchy and find the set W
of all WeldConstraint, Weld and ManualWeld objects that reference P
w
in W
(this is a graph where welds are edges and parts are nodes) to define the complete connected subgraph of partsThe problem:
The above method is highly inefficient, and it would require me to do a workspace-wide bookkeeping effort to handle efficiently. However, since the physics engine already needs an efficient representation of that connectivity graph, I would assume that the physics engine should expose an API to tap into that. However, I haven't found that API? Is anyone aware of such API?
Motivation:
There is several use cases that I will need this for in the near future, most urgently:
Scripts that are supposed to work on "dynamic" (i.e. unanchored) parts Q
must, generally speaking, make sure that any Q
is not welded (directly or indirectly) to an anchored part, or else, it might generate some very strange physical behavior because it tries to treat a part that is welded to an anchored part as freely moving about.