*
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class OrientationSensor : MonoBehaviour {
|
||||
public Quaternion orientation = Quaternion.identity;
|
||||
public Vector3 right = Vector3.right;
|
||||
public Vector3 up = Vector3.right;
|
||||
public Vector3 forward = Vector3.right;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
public void FixedUpdate () {
|
||||
orientation = transform.rotation;
|
||||
right = orientation * Vector3.right;
|
||||
up = orientation * Vector3.up;
|
||||
forward = orientation * Vector3.forward;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user