# API

## Methods

## Translate

<mark style="color:green;">`POST`</mark> `Translate(Vector3 velocity)`

Invoking this method will recalculate the position of the object the *Handle* is attached to, taking the new velocity into account.

#### Path Parameters

| Name     | Type   | Description                                                       |
| -------- | ------ | ----------------------------------------------------------------- |
| Velocity | number | Vector3 that represents the force you are applying to the object. |

{% tabs %}
{% tab title="200 You can move the object by applying forces this way." %}

```csharp
//Get a handle to use for this transform.
Handle handle = MotionManager.Subscribe(transform, data...); 

//We move the object upwards.
handle.Translate(Vector3.up * 3);
```

{% endtab %}
{% endtabs %}

## Rotate

<mark style="color:green;">`POST`</mark> `Rotate(Vector3 velocity)`

Invoking this method will recalculate the rotation of the object the *Handle* is attached to after adding the new velocity.

#### Path Parameters

| Name     | Type   | Description                                                                |
| -------- | ------ | -------------------------------------------------------------------------- |
| Velocity | number | Vector3 that represents the rotation force you are applying to the object. |

{% tabs %}
{% tab title="200 We first need to have a Handle, then we can invoke the method to rotate the object." %}

```csharp
//Get a handle to use for this transform.
Handle handle = MotionManager.Subscribe(transform, data...); 

//We rotate the object on the X axis.
handle.Rotate(Vector3.right * 5);
```

{% endtab %}
{% endtabs %}

## Scale

<mark style="color:green;">`POST`</mark> `Scale(Vector3 velocity)`

Invoking this method will make the *Handle* recalculate the scale of its attached object, taking into account the new scale velocity.

#### Path Parameters

| Name     | Type   | Description                                                             |
| -------- | ------ | ----------------------------------------------------------------------- |
| Velocity | number | Vector3 that represents the scale force you are applying to the object. |

{% tabs %}
{% tab title="200 As with the other methods, we first need a Handle for our object, we can then use the Scale method to change its scale." %}

```csharp
//Get a handle to use for this transform.
Handle handle = MotionManager.Subscribe(transform, data...); 

//We scale the object.
handle.Scale(new Vector3(2, 2, 2));
```

{% endtab %}
{% endtabs %}

## Extension Methods

## PlayStop

<mark style="color:green;">`POST`</mark> `PlayStop(SequenceStop stop, float multiplier)`

Invoking this method will play a stop on this *Handle*, it will also apply the multiplier passed to it

#### Path Parameters

| Name       | Type   | Description                                                                         |
| ---------- | ------ | ----------------------------------------------------------------------------------- |
| Multiplier | number | Simple multiplier to change the forces a bit.                                       |
| Stop       | object | SequenceStop value that determines what forces to apply and how long to apply them. |

{% tabs %}
{% tab title="200 We can call this method whenever and it will apply the forces for the amount of time we have set." %}

```csharp
[SerializeField]
private SequenceStop stop;

private void Start(){
    handle.PlayStop(stop);
}
```

{% endtab %}
{% endtabs %}

## PlaySequence

<mark style="color:green;">`POST`</mark> `PlaySequence(SequenceStop[] stops)`

Invoking this method will play a sequence of stops, all of these stops have their own sets of forces and will take a specific time to complete.

#### Path Parameters

| Name  | Type  | Description                                                            |
| ----- | ----- | ---------------------------------------------------------------------- |
| Stops | array | Array of stops that you are trying to apply to this *Handle's* object. |

{% tabs %}
{% tab title="200 " %}

```csharp
[SerializeField]
private SequenceStop[] stops;

private void Start(){
    //Get the handle and play the sequence.
    handle = ...;
    handle.PlaySequence(stops);
}
```

{% endtab %}
{% endtabs %}
