# Data Model

## Overview

**The data model that describes an avatar is the Model of the Avatar module**. From this Model (or its View) you can navigate through the avatar and reach the references, registered modules or variables you need.

Here's the definition of the concepts that will refer to the different components of an avatar:

* **Avatar:** Group of bodies controlled by the same user.
* **Body:** Tree structure of parts and bones.
* **Part:** Section of a body. Can contain parts and bones.
* **Bone:** Terminal section of a part. Contain points. Slave will have a Rigidbody per bone.
* **Point:** Abstract representation of a point in space.
* **Representation:** Actual representation of a point.

## Relations

In a nutshell:

* **An avatar can have multiple bodies.**
  * Having just one body is most common use case.
* **A body is composed of a tree of parts.**
  * A body have (1,1) root part.
* **A part can have (0,n) child parts and (1,n) bones.**
  * An arm (part) have two bones (upper arm and forearm) and a hand (child part).
  * A hand (part) have one bone (wrist) and 5 fingers (child parts), each of them composed of 3 or 4 bones and 0 child parts.
* **A bone have (1,n) points.**
  * Most bones have only one point but, for isntance, wrist bone contains the wrist point and also some other important palm points like interior, exterior, center and normal.
* **A point have (1,n) representations.**
  * A representation is a link between a point and a Transform that is identified by a name. If we use physics we will have "master" and "slave" (puppet) representations.
  * In order to prevent hard-coding keys, `AvatarModel.key` and `PuppetModel.key` store the keys for the master and slave representations respectively.

![Detailed view of the components of an avatar](/files/-Mgfq9y0r1VUQEvWcgxJ)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jorge-jgnz94.gitbook.io/hptk/master/data-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
