VG_Assemble is a public script that provides a tutorial on the minimal VG API functions for assembling and disassembling objects through VG joint changes.
This is a mono behavior and is used as a component to attach to the Game Object which you want to assemble or disassemble from some other objects.
Several examples in VG_Onboarding scene in VirtualGrasp\Scenes\onboarding are using this script to achieve various assembling tasks (see task2 radio disassemble, task5 bottle, task7 chain assemble and task8 screw assemble).
|Assemble To Parent||If current object will be reparented to the desired pose’s parent.||See examples in task5 bottle and task8 screw assemble.|
|Desired Poses||The transform(s) specifying the desired pose of this object or this object’s Assemble Anchor.||Usually these transforms are the child of the object this object is attached to after assembling.|
|Assemble Distance||The distance (m) threshold (between object or its Assemble Anchor to the desired poses) below which the assembling can be triggered.||Both linear distance and angular distance have to reach the thresholds to trigger assembling.|
|Assemble Angle||The angular distance (deg) threshold (between object or its Assemble Anchor to the desired poses) below which the assembling can be triggered.||Both linear distance and angular distance have to reach the thresholds to trigger assembling.|
|Assemble Axis||Along which axis the Assemble Angle threshold is measuring the rotational difference. For rotational symetric object, sometimes we only need to align the rotation axis to the desired pose. If (0,0,0), then requires whole rotation match to the desired pose.|
|Assemble Anchor||The transform representing the anchor on this object to be attached to the Desired Poses. If not assigned, then the anchor will be this object’s origin.||This transform has to be the child of this object.|
|Disassemble Distance||The distance (m) threshold (between object or its Assemble Anchor to the desired poses) above which the disassembling is triggered.|
|Disassemble On Zero State||If triggering disassembling also requires the object current joint state is zero. This is simulating the situation when disassembling screw joint requires screw being fully loosened.||See examples when disassembling cap from bottle in task5 bottle and disassembling screws from the box task8 screw assemble.|
|Assemble Articulation||The VG_Articulation of a non-Floating joint type the object switches to (from Floating type) when assembled. If not provided, the object will switch to fixed joint type.||You can add a VG_Articulation component with desired joint type to the object and drag it to this entry.|
|Disassemble Articulation||The VG_Articulation of floating joint type. Must be provided if object initially is non-floating joint type.||See examples in task2 radio disassemble.|
|Force Disassembled Physical||If checked will make sure when an object is disassembled (switched to floating joint) rigidbody and collider is added to make this object physical.||This is only relevant when object initially is at an assembled state (initial joint is non-floating). See examples in task2 radio disassemble.|
|On Assembled||Event triggered when object is assembled.|
|On disassembled||Event triggered when object is disassembled.|