I understand what you want to do but it doesn’t work for certain case.
For exemple, in this picture (green circle are pivots), it doesn’t work.
Because the shortest distance between black and red actors isn’t “between” pivots.
You will have to throw some math at this problem. If you create functions that describe the surfaces of the objects, you can then subtract these functions from one another and calculate the first derivative. Solve the resulting function for [insert function] = 0. This is the only way to do this mathematically without checking every possible vector by hand. (The only way I can think of right now, anyways). Feel free to ask more questions regarding this.
Well, nothing that would be a reasonable amount of effort, I fear.
I think the question here is: how accurate do you need this to be? What you could try is: use multiple expanding sphere collisions at the objects’ surface points. Once one of the spheres overlaps, it’s radius is your distance.
well… “all surface points” is not wise, since that would mean minimum increments, with vectors being defined as 3 floats, that is a lot of points. Generally the faces between vertices are linear, so you could move along the edges of the object. What are you trying to achieve with this? Maybe we are over-complicating this.
I’m trying to create some tools for an application.
For exemple, i have a constraint on certain objects, they have a minimum distance to others and i want to detect all the ojects inside this minimum distance.
Or, I want to find the nearest object of a selected mesh.
You could add custom collision shapes for the meshes by hand and adjust the size to (roughly) fit the distances you want, that way you can get all the actors inside that distance. The DistanceToNearestSuface material node might help with highlighting how close one point of a surface is to the next surface. You can also look into the SceneTexture node and potentially work with Scene Depth.
In the end, if you want high accuracy you will have to do a lot of work.