Description

VG_Articulation is an internal script that provides the main interface to mark an object as interactable (see object identifiers), as well as to parametrize its object articulation and interactive behavior.

By default, the VG_articulation component sets an object to have floating joint type. If an object is non-physical (i.e. no Rigidbody or ArticulationBody component), constrained (non-floating) joint types can be specified.

VG Articulation
The default VG_Articulation Component (FLOATING joint).

As soon as you change the joint type, the interface will change dynamically.

VG Articulation
VG_Articulation dynamic interface after changing to REVOLUTE joint.

All the parameters are explained in detail in object articulation.

When you want to enable this script, you have to add it on the same GameObject that you want your script to work for.
If you add multiple VG_Articulation components to a game object, the first active component will be used to configure your initial object articulation.
If only an inactive VG_Articulation component is added to a game object, the object will be registered to VirtualGrasp and included in the baking process, however its interactability is temporarily disabled (equivalent to SetObjectSelectionWeight to 0).

Runtime Changes

Regardless of what is the initial setting of an object’s articulation, you can change the object’s articulation parameters in runtime through scripting using the API functions ChangeObjectJoint and RecoverObjectJoint.

ChangeObjectJoint

One of the two ChangeObjectJoint API functions receives an VG_Articulation component as input for the object articulation settings you want to apply.

To do that, you can add a disabled VG_Articulation component to the object, which your script can receive and use as the argument in the ChangeObjectJoint function.

As a result, all the parameters set in the component will be specified in runtime on the object.

RecoverObjectJoint

If you want to recover the object joint to its original parameters set by the enabled VG_Articulation component, you can call the RecoverObjectJoint API function.