Interaction behaviors wanted
- We want to assemble a set of objects (chain loops in this example) into a chain connected through VG joint (used cone joint), while able to freely determine who is the parent and who is the child.
In VirtualGrasp SDK, we packed the solution of this task in VirtualGrasp/Scenes/onboarding.
Assemble and disassemble chain loops to each other
VG_Assemble component is used for assembling and disassembling the chain loop to each other to form a chain. Above image shows the setting for the component on one of the 4 chain loops. A few things to point out:
- Since when we assemble the chain loop to each other, we want the loop to attach to another loop as its child, we check Assemble To Parent flag.
- Since we have totally 4 chain loops, and each one can assemble to the other 3 loops, we have 3 Desired Poses anchor_target transforms as children of the other 3 loops respectively.
- Since each chain loop is a rotational symmetric object, so assemble angle threshold just need to make sure its symmetry axis is aligned with desired pose. This axis is represented by the z-axis of the Assemble Anchor on the loop. Therefore Assemble Axis is set to be (0, 0, 1) to indicate z-axis of the anchor should match that of anchor_target.
- Because when assembled, the chain loop is using cone joint, a disabled VG_Articulation with cone joint is added to this game object and drag it to Assemble Articulation entry.
- Because the chain loop initially is at the disassembled state (floating joint), we don’t need to assign Disassemble Articulation entry.
- Because the chain loop initially is at the disassembled state (floating joint), if the object initially is physical, when disassembled it will always recover its physical properties automatically handled by VG. Therefore Force Disassembled Physical flag does not need to be checked.