Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

TryGetInteractionSourcePose Is failing (not unity, C++)

mlfarrellmlfarrell
edited August 2017 in Q&A and Discussions

Please no unity answers.

The following code is failing for my app until I let the controller go to sleep and then resume while running. Not sure if this is a bug in the SDK or... ??

      if(auto pose = state->TryGetPointerPose(currentCoordinateSystem))
      {
        if(source->IsPointingSupported)
        {
          if(auto controllerPose = pose->TryGetInteractionSourcePose(source)) //FAILS
          {
            controllerRay = { convFloat3(controllerPose->Position), convFloat3(controllerPose->ForwardDirection) };

            auto uwpQuat = controllerPose->Orientation;
            quat q(uwpQuat.x, uwpQuat.y, uwpQuat.z, uwpQuat.w);

            mat4 orientation4;
            q.toMatrix(orientation4.m);

            currentInputState.inputDevices[evState.deviceIndex].position = controllerRay.o;
            currentInputState.inputDevices[evState.deviceIndex].forwardVector = controllerRay.d;
            currentInputState.inputDevices[evState.deviceIndex].upVector = convFloat3(controllerPose->UpDirection);

            static mat4 poses[8];
            currentInputState.inputDevices[evState.deviceIndex].pose = &poses[evState.deviceIndex];
            poses[evState.deviceIndex] = orientation4;

            currentInputState.inputDevices[evState.deviceIndex].side = (evState.deviceIndex == 0) ? InputState::InputDevice::DS_RIGHT
              : InputState::InputDevice::DS_LEFT;

            evState.orientation = mat4GetMatrix3(orientation4);
          }
        }
        else
        {
          controllerRay = { convFloat3(pose->Head->Position), convFloat3(pose->Head->ForwardDirection) };
        }
      }

Tagged:

Best Answer

Answers

  • Options

    I gave this another try last night. The API is definitely failing until I pause the app and let it stay paused for ... 5 seconds and then resume. This feels like a bug? Is there any info from MS or DirectX people as to a better workaround or should I just wait for another bugfix update?

  • Options
    mlfarrellmlfarrell
    Answer ✓

    Fixed on latest insider build

Sign In or Register to comment.