API

Methods

Translate

POST 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.

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

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

Rotate

POST 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.

//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);

Scale

POST 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.

//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));

Extension Methods

PlayStop

POST 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.

[SerializeField]
private SequenceStop stop;

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

PlaySequence

POST 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.

[SerializeField]
private SequenceStop[] stops;

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

Last updated

Was this helpful?