Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
695 B

namespace VRTK.Examples
{
using UnityEngine;
public class Remote_Beam : MonoBehaviour
{
private Vector2 touchAxis;
private float rotationSpeed = 180f;
private float currentYaw;
private float currentPitch;
public void SetTouchAxis(Vector2 data)
{
touchAxis = data;
}
private void FixedUpdate()
{
currentYaw += touchAxis.y * rotationSpeed * Time.deltaTime;
currentPitch += touchAxis.x * rotationSpeed * Time.deltaTime;
transform.localRotation = Quaternion.AngleAxis(currentPitch, Vector3.up) * Quaternion.AngleAxis(currentYaw, Vector3.left);
}
}
}