Modules

Introduction

This section seeks to act as guide to implement new HPTK modules. Structure of HPTK modules is described in detail here.

HPTK modules can be child of:

  • AvatarModel.

  • BodyModel.

  • PartModel (HandModel or FingerModel).

Requirements

Custom HPTK modules must fulfill the following requirements:

  • Follow MVC pattern.

  • Overriden functions must call their base function.

  • View must expose only safe operations.

    • It shouldn't be possible to make the module fail from the view.

  • View must hide the reference to its model.

  • Controller must self-register in its parent's registry as soon as possible (Awake).

  • Controller must search the reference to the other 2 components if missing.

  • Controller shouldn't update if its GameObject is disabled.

  • Model must work with only the reference to its parent module.

    • Numbers and strings must have a default value.

    • Missing references must be searched in the scene automatically if they are missing.

    • If some mandatory references or value could not be found, a warning or error message should be logged and the module should be automatically disabled.

Code skeletons

Model:

View:

Controller:

Last updated

Was this helpful?