We have a series of VG onboarding tasks to show how to tackle different practical use cases using VirtualGrasp in a VR application. In VirtualGrasp SDK, they are packed in VirtualGrasp\Scenes\onboarding.

Task Description

If this video shows "This video is unavailable," please try to refresh the page.

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.

Solution

In VirtualGrasp SDK, we packed the solution of this task in VirtualGrasp/Scenes/onboarding.

VirtualGrasp/Scenes/onboarding/VG_Onboarding.unity

Assemble and disassemble chain loops to each other

VG Assemble setup for a chain loop.
VG Assemble setup for a chain loop.

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 we want each chain loop to be assembled as long as the longest 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 “Z Axis” to indicate z-axis of the anchor should match that of anchor_target. Because only the axis alignment is required, Assemble Symmetry Steps is set to be 0.
  • 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.