Example #1
0
        internal bool TryGetUncalibratedPose(DeviceUse use, out Pose pose)
        {
            if (!_deviceManager.TryGetDeviceState(use, out TrackedDevice device) || !device.isTracking)
            {
                pose = Pose.identity;
                return(false);
            }

            pose = new Pose(device.position, device.rotation);

            _trackingHelper.ApplyRoomAdjust(ref pose.position, ref pose.rotation);

            SpawnedAvatar spawnedAvatar = _avatarManager.currentlySpawnedAvatar;

            switch (use)
            {
            case DeviceUse.Head:
            case DeviceUse.LeftHand:
            case DeviceUse.RightHand:
                _trackingHelper.ApplyFloorOffset(spawnedAvatar, ref pose.position);
                break;

            default:
                _trackingHelper.ApplyTrackerFloorOffset(spawnedAvatar, ref pose.position);
                break;
            }

            return(true);
        }
Example #2
0
        public bool TryGetPose(DeviceUse use, out Pose pose)
        {
            if (!_internalPlayerInput.TryGetPose(use, out pose))
            {
                return(false);
            }

            _trackingHelper.ApplyRoomAdjust(ref pose.position, ref pose.rotation);

            return(true);
        }