Before I get into what exactly I’m having trouble with I’ll give a little context to what kind of system I’m trying to create.
The basic idea is to create a system that can attach two objects to each other via predefined “points” on each object. This operation would be looped any number of times with the first object to be placed being the “parent” or “base” that will have a child/s attached to it, then the now attached child becomes the parent and the cycle continues…
NOTE, I am working with instanced static meshes so the “parent the mesh to a dummy component” solution won’t work. Everything will have to be done purely mathematically.
This is the basic idea of what I’m ultimately intending to do, obviously there is a ton of other logic to be built before anything useful can be constructed. (although I have a lot of that done already lol).
So far, I’ve been able to get the “child” object into the correct location where the chosen points on both the “child” and “parent” are in the same location, as you can see here:
I’ve also stored the transforms for the point on the parent, child, and the child object’s origin as I know I’ll need all three.
The part that I’m struggling with has to with the math portion. More specifically the rotation of a transform about an arbitrary point. (not sure if the term “transform” is correct here but hopefully you get what I mean)
Important thing to note is that the “points” I mentioned earlier are mesh sockets. I’m using sockets as they contain their own transform data not just location and this will be important as the object being attached to the proverbial “base” or “parent” will need to align itself something like this:
All sockets will always have their Z-axis pointing away from the surface of the object. This is intended to be used to align the “child” to the “parent”
Honestly, I’ve been at this for the better part of a month and the deeper I dove into it the more I ran into mathematical concepts that are frankly beyond me (matrix math, quaternions).
Any help at this point would be greatly appreciated.