TestController
来源:互联网 发布:天猫实时大数据 编辑:程序博客网 时间:2024/06/06 07:00
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(LineRenderer))]
public class TestController : MonoBehaviour {
SteamVR_TrackedObject tracked;LineRenderer line;public GameObject model;// Use this for initializationvoid Start () { tracked = this.GetComponent<SteamVR_TrackedObject>(); line = this.GetComponent<LineRenderer>();}// Update is called once per framevoid Update () { SteamVR_Controller.Device device = SteamVR_Controller.Input((int)tracked.index); if (device.GetPress(SteamVR_Controller.ButtonMask.Trigger)) { Debug.Log("按下扳机键"); Ray ray = new Ray(model.transform.position, model.transform.forward); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { line.SetPosition(0, ray.origin); line.SetPosition(1, hit.point); } } //if ( device.GetPressDown(SteamVR_Controller.ButtonMask.ApplicationMenu)) //{ // Debug.Log("按下应用菜单键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Axis0)) //{ // Debug.Log("按下控制轴0键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Axis1)) //{ // Debug.Log("按下控制轴1键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Axis2)) //{ // Debug.Log("按下控制轴2键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Axis3)) //{ // Debug.Log("按下控制轴3键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Axis4)) //{ // Debug.Log("按下控制轴4键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Grip)) //{ // Debug.Log("按下手柄两侧的键位"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.System)) //{ // Debug.Log("按下系统键"); //} //if (device.GetPressDown(SteamVR_Controller.ButtonMask.Touchpad)) //{ // Debug.Log("按下触摸板键"); //}}
}
0 0
- TestController
- TestController
- jni/../../Classes/AppDelegate.cpp:102: error: undefined reference to 'TestController::TestController
- Spring test TestController 一直不行,没报任何错误
- jni/../../Classes/AppDelegate.cpp:102: error: undefined reference to 'TestController::TestC...
- 遍历(也称迭代)容器的4种常用方式
- BFS:HDU-1242-Rescue(带守卫的迷宫问题)(优先队列)
- 【JZOJ5055】【GDOI2017模拟二试4.12】树上路径
- HDU
- Activity切换(带参数)
- TestController
- Java应用集群下的定时任务处理方案(mysql)
- 企业所得税
- django Rest Framework 系列 1
- CodeForces
- 有关Java Collections的几个常见问题
- sql优化
- Latex使用小结(1)
- Quartz定时调度框架