Created
August 11, 2016 11:38
-
-
Save kkostenkov/e8a3bed9449d016a025af00fb1323354 to your computer and use it in GitHub Desktop.
Script that uses HTC Vive cam position to set position of Perception Neuron in Unity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class VrPosSync : MonoBehaviour { | |
public Transform viveCamEye; | |
public Transform neuronHead; | |
public Transform neuronPelvis; | |
void LateUpdate () { | |
Vector3 headPelvisOffset = neuronHead.position - neuronPelvis.position; | |
neuronPelvis.position = viveCamEye.position - headPelvisOffset; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment