PinnedTransformGesture

Random discussions.

PinnedTransformGesture

Postby SmartyPants » Mon Oct 24, 2016 10:02 am

Hello,

Any Ideas why the below code sometimes reverses the direction of the rotation ?

Kind Regards

M

using UnityEngine;
using System.Collections;
using TouchScript.Gestures;

//



public class Orbit : MonoBehaviour

{

private PinnedTransformGesture gesture;

private void OnEnable()
{
gesture = GetComponent<PinnedTransformGesture>();
gesture.Transformed += transformedHandler;
}

private void OnDisable()
{
gesture.Transformed -= transformedHandler;
}

private void transformedHandler(object sender, System.EventArgs e)
{

transform.localRotation *= Quaternion.AngleAxis(gesture.DeltaRotation, gesture.RotationAxis);

}

}
SmartyPants
 
Posts: 2
Joined: Tue Sep 27, 2016 11:33 am

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest