I am scribbling out my concept for a self assembling spring system. Just wanted to get any thoughts, pointers, or strategies. Please see the attached scribbles.
The user would place different types of “cubes” snapped to a 3d grid. This would happen in an editor level. (Paused at zero time) This part is easy and has lots of tutorials for Minecraft.
This is where it gets more interesting.
The user created cubes would be saved and loaded into the simulation level.
The cubes will not be rendered. The center of each cube would be found.
Springs would be created between each center and its neighboring centers. I am calculating spring forces directly, not using the built in spring joints in the editor. F=kX.
Certain cube types are oscillators, causing the attached springs to expand then contract.
Neighbors are calculated once in Start. This keeps the springs from getting too disordered. [Could be interesting to update the neighbors for gelatinous fog type behaviour/ polarized assembly]
The centers without full neighbors are on the outside and are used as the vertices for rendering meshes at run time.
In Start
For each center:
Get Neighbors;
In FixedUpdate
For each neighbor:
Get Distance
Get Direction
Calculate forces (Spring force, drag, expansion force)
Apply forces

