Drill

The drill module enables the developer to set up a Unity GameObject as a drill tool, in order to achieve real time drilling of holes on 3D rigged and static models.

Set up

To use the Drill Module, you need to attach the Drill component onto the gameobject that we want to use as a drill. Simply click Add Component> MAGES > Mesh Deformations > Drill to add the component.

Note

The scale of the gameObject that this script is attached to, affects the scaling of the drill area.

../../../_images/drillComponent.png

This gives you the following properties:

  1. Parallel Computation:

  • Option to run the code in parallel for increased performance.

  1. Local Densing:

  • Option to split every affected triangle of the drilling into four smaller ones, in order to prevent the smaller diameter holes looking like polygons.

  1. Use Interactable Item

  • Option to use this script in combination with an interactable item, such that when you have this object in your hand and then press the trigger button a drill is performed.

  1. Drill Area:

    • Option to set up the drilling axis and the radius of the drill.

      Note

      Make sure Gizmos are enabled on the Unity editor.

      • Click the edit button shown in the image below:

      ../../../_images/drillAreaEditor.png
      • Use the handles shown in the scene to adjust the drill area to your requirements as shown below:

      ../../../_images/drillArea.png

That last step that remains is to add a trigger collider component to the gameObject, that is aligned with the drill axis GUI that we created before:

In our example we are going to add a Box Collider.

../../../_images/colliderDrillArea.png

Properties

Property

Description

bool parallelize

Minimize running times by executing the code in parallel.

bool localDensing

Split every affected triangle of the drilling into four smaller ones, in order to prevent the smaller diameter holes looking like polygons.

DrillAxis drillArea

Set up the drilling axis and the radius of the drill

UnityEvent OnDrillPerformed

Called whenever after this script successfully modifies a mesh section.