Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Camera System Refactor #66

Merged
merged 14 commits into from
Apr 23, 2020
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void UpdateGripData(InteractionSourceState interactionSourceState, Mixed
interactionSourceState.sourcePose.TryGetPosition(out currentGripPosition, InteractionSourceNode.Grip);
interactionSourceState.sourcePose.TryGetRotation(out currentGripRotation, InteractionSourceNode.Grip);

var cameraRig = MixedRealityToolkit.CameraSystem?.CameraRig;
var cameraRig = MixedRealityToolkit.CameraSystem?.MainCameraRig;

if (cameraRig != null &&
cameraRig.PlayspaceTransform != null)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 00d813fd5a164e19a160f322b2926006, type: 3}
m_Name: WindowsMixedRealityCameraProviderProfile
m_EditorClassIdentifier:
isCameraPersistent: 1
nearClipPlaneOpaqueDisplay: 0.1
cameraClearFlagsOpaqueDisplay: 1
backgroundColorOpaqueDisplay: {r: 0, g: 0, b: 0, a: 1}
opaqueQualityLevel: 0
nearClipPlaneTransparentDisplay: 0.85
cameraClearFlagsTransparentDisplay: 2
backgroundColorTransparentDisplay: {r: 0, g: 0, b: 0, a: 0}
transparentQualityLevel: 0
cameraRigType:
reference: XRTK.Services.CameraSystem.DefaultCameraRig, XRTK
defaultHeadHeight: 0
bodyAdjustmentAngle: 60
bodyAdjustmentSpeed: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions XRTK.WindowsMixedReality/Packages/com.xrtk.wmr/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using XRTK.Definitions.CameraSystem;
using XRTK.Interfaces.CameraSystem;
using XRTK.Providers.CameraSystem;

namespace XRTK.WindowsMixedReality.Providers.CameraSystem
{
public class WindowsMixedRealityCameraDataProvider : BaseCameraDataProvider
{
/// <inheritdoc />
public WindowsMixedRealityCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile, IMixedRealityCameraSystem parentService)
: base(name, priority, profile, parentService)
{
}

/// <inheritdoc />
public override bool IsOpaque
{
get
{
#if UNITY_WSA
return UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque;
#else
return base.IsOpaque;
#endif
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public HandData GetHandData(SpatialInteractionSourceState spatialInteractionSour

// We want the controller to follow the Playspace, so fold in the playspace transform here to
// put the controller pose into world space.
unityJointPositions[i] = MixedRealityToolkit.CameraSystem.CameraRig.PlayspaceTransform.TransformPoint(unityJointPositions[i]);
unityJointOrientations[i] = MixedRealityToolkit.CameraSystem.CameraRig.PlayspaceTransform.rotation * unityJointOrientations[i];
unityJointPositions[i] = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform.TransformPoint(unityJointPositions[i]);
unityJointOrientations[i] = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform.rotation * unityJointOrientations[i];

TrackedHandJoint handJoint = jointIndices[i].ToTrackedHandJoint();
updatedHandData.Joints[(int)handJoint] = new MixedRealityPose(unityJointPositions[i], unityJointOrientations[i]);
Expand Down