using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

public class Sample04b : MonoBehaviour {
  public GameObject target;
  public float radius = 2.0f;
  NtUnity.Kinect nt;
  void Start () {
    nt = new NtUnity.Kinect();
  }
  void Update () {
    nt.setRGB();
    nt.setSkeleton();
    nt.setFace();
    nt.imshowBlack();
    
    nt.setAudio(false);
    if (nt.beamAngleConfidence < 0.5) return;
    double theta = nt.beamAngle;
    double x = radius * Math.Sin(theta);
    float y = target.transform.position.y; 
    double z = radius * (-Math.Cos(theta));
    target.transform.position = new Vector3((float)x,y,(float)z);
  }
}
