/// <summary> /// Capture a snapshot of simulated motion controller data based on current state. /// </summary> public void UpdateControllerData(SimulatedMotionControllerData motionControllerDataLeft, SimulatedMotionControllerData motionControllerDataRight, MouseDelta mouseDelta) { SimulateUserInput(mouseDelta); SimulatedMotionControllerState motionControllerStateLeft = InputStateLeft as SimulatedMotionControllerState; SimulatedMotionControllerState motionControllerStateRight = InputStateRight as SimulatedMotionControllerState; motionControllerStateLeft.Update(); motionControllerStateRight.Update(); // Cache the generator delegates so we don't gc alloc every frame if (updaterLeft == null) { updaterLeft = motionControllerStateLeft.UpdateControllerPose; } if (updaterRight == null) { updaterRight = motionControllerStateRight.UpdateControllerPose; } motionControllerDataLeft.Update(motionControllerStateLeft.IsTracked, motionControllerStateLeft.ButtonState, updaterLeft); motionControllerDataRight.Update(motionControllerStateRight.IsTracked, motionControllerStateRight.ButtonState, updaterRight); }
public SimulatedMotionControllerDataProvider(MixedRealityInputSimulationProfile _profile) : base(_profile) { InputStateLeft = new SimulatedMotionControllerState(Handedness.Left); InputStateRight = new SimulatedMotionControllerState(Handedness.Right); }