Skip to content

Commit

Permalink
re #21 improving feedback on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrankin committed Apr 18, 2018
1 parent 0f90285 commit 4b9eb47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions HoloIntervention/Assets/Data/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
XMaxMeters="0.8"
YMinMeters="0.2"
YMaxMeters="0.8"
ZMinMeters="0.2"
ZMaxMeters="0.8"/>
ZMinMeters="-0.8"
ZMaxMeters="-0.2"/>
</TargetSphereTask>

<RegisterModelTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,29 +399,29 @@ namespace HoloIntervention
return;
}

float4x4 AnchorToEye;
auto stereoTransform = cameraPose->TryGetViewTransform(m_worldAnchor->CoordinateSystem);
if (stereoTransform == nullptr)
{
LOG_ERROR("Unable to request stereo view to anchor.");
return;
}
XMStoreFloat4x4(&AnchorToEye, XMLoadFloat4x4(m_currentEye == EYE_LEFT ? &stereoTransform->Value.Left : &stereoTransform->Value.Right));
float4x4 eyeToAnchor;
invert(AnchorToEye, &eyeToAnchor);
// float4x4 anchorToEye;
// auto stereoTransform = cameraPose->TryGetViewTransform(m_worldAnchor->CoordinateSystem);
// if (stereoTransform == nullptr)
// {
// LOG_ERROR("Unable to request stereo view to anchor.");
// return;
// }
// XMStoreFloat4x4(&anchorToEye, XMLoadFloat4x4(m_currentEye == EYE_LEFT ? &stereoTransform->Value.Left : &stereoTransform->Value.Right));
// float4x4 eyeToAnchor;
// invert(anchorToEye, &eyeToAnchor);

// Separately, update the virtual model to be 1m in front of the current eye
float4x4 HMDToEye;
stereoTransform = cameraPose->TryGetViewTransform(hmdCoordinateSystem);
float4x4 hmdToEye;
auto stereoTransform = cameraPose->TryGetViewTransform(hmdCoordinateSystem);
if (stereoTransform == nullptr)
{
LOG_ERROR("Unable to request stereo view to HMD.");
return;
}
XMStoreFloat4x4(&HMDToEye, XMLoadFloat4x4(m_currentEye == EYE_LEFT ? &stereoTransform->Value.Left : &stereoTransform->Value.Right));
XMStoreFloat4x4(&hmdToEye, XMLoadFloat4x4(m_currentEye == EYE_LEFT ? &stereoTransform->Value.Left : &stereoTransform->Value.Right));

float4x4 eyeToHMD;
invert(HMDToEye, &eyeToHMD);
invert(hmdToEye, &eyeToHMD);
auto point = transform(float3(0, 0, -1), eyeToHMD);
m_modelEntry->SetDesiredPose(make_float4x4_translation(point));

Expand All @@ -433,6 +433,7 @@ namespace HoloIntervention
{
m_sphereIconEntry->GetModelEntry()->SetRenderingState(Rendering::RENDERING_GREYSCALE);
}
m_notificationSystem.QueueMessage(L"Can't see sphere!", 1.f);
m_pointCaptureRequested = false;
return;
}
Expand Down

0 comments on commit 4b9eb47

Please sign in to comment.