コード例 #1
0
        public void ResetSensor()
        {
#if hOPENVR
            if (viveTracker != null)
            {
                List <ViveTrackerComponent> viveTrackers = hipsTarget.humanoid.openVR.viveTrackers;
                viveTrackers.Add(ViveTracker.NewViveTracker(hipsTarget.humanoid, (uint)viveTracker.trackerId));
                viveTracker.trackerId = -1;
            }
#endif
        }
コード例 #2
0
ファイル: SteamVR.cs プロジェクト: lavrri/Cuba-Connection
        protected virtual void OnNewSensor(uint sensorId)
        {
            Passer.ETrackedDeviceClass deviceClass = Passer.OpenVR.System.GetTrackedDeviceClass(sensorId);
            switch (deviceClass)
            {
            case Passer.ETrackedDeviceClass.HMD:
                hmd = FindHmd(sensorId);
                if (hmd == null)
                {
                    hmd = SteamVrHmdComponent.NewHmd(humanoid, (int)sensorId);
                }
                break;

            case Passer.ETrackedDeviceClass.TrackingReference:
                SubTracker subTracker = FindLighthouse(sensorId);
                if (subTracker == null)
                {
                    subTracker = NewLighthouse(humanoid, sensorId);
                    subTrackers.Add(subTracker);
                }
                break;

            case Passer.ETrackedDeviceClass.Controller:
                SteamVrControllerComponent controller = FindController(sensorId);
                if (controller == null)
                {
                    controller = SteamVrControllerComponent.NewController(humanoid, (int)sensorId);
                    controllers.Add(controller);
                }
                break;

#if hVIVETRACKER
            case Passer.ETrackedDeviceClass.GenericTracker:
                ViveTrackerComponent viveTracker = FindViveTracker(sensorId);
                if (viveTracker == null)
                {
                    viveTracker = ViveTracker.NewViveTracker(humanoid, sensorId);
                    viveTrackers.Add(viveTracker);
                }
                break;
#endif
            default:
                break;
            }
        }