Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver Handler Transform Synchonization #2789

Conversation

StephenHodgson
Copy link
Contributor

@StephenHodgson StephenHodgson commented Sep 14, 2018

Overview

Example of solver handler implementation using IMixedRealityControllerPoseSynchronizer

Fixes: #2785

(I only added a solver handler to the parabolic pointer as trying 2018.3 may have temporarily broke prefab editing for me)

@keveleigh
Copy link
Contributor

Is this solution is to put a ControllerPoseSynchronizer on every solver?

@StephenHodgson
Copy link
Contributor Author

Is this solution is to put a ControllerPoseSynchronizer on every solver?

No, this doesn't make that a requirement

@keveleigh
Copy link
Contributor

But to track controllers, it is?

@StephenHodgson
Copy link
Contributor Author

StephenHodgson commented Sep 14, 2018

But to track controllers, it is?

Not the concrete type, but the IMixedRealityControllerPoseSynchronizer, yes. or else how would you get any data about any controller?

@keveleigh
Copy link
Contributor

Using a controller pose synchronizer for every solver that needs to track a controller does not fulfill the acceptance criteria for #2785 of

Doesn't add another global listener to the scene

@StephenHodgson
Copy link
Contributor Author

StephenHodgson commented Sep 14, 2018

Doesn't add another global listener to the scene

It doesn't. It's using the ones we're already using.

This definitely fulfills those requirements.

@keveleigh
Copy link
Contributor

keveleigh commented Sep 14, 2018

It's using the ones we're already using.

If I create a new prefab that adds a cube tracking the front of my right controller via solver, I will not need to add a new controller pose synchronizer to it?

@StephenHodgson
Copy link
Contributor Author

Nope, not as long as you get your right controller's IMixedRealityControllerPoseSynchronizer reference

@keveleigh
Copy link
Contributor

Where can I get that reference?

@StephenHodgson
Copy link
Contributor Author

It gets it for you, if the handler is already attached to a game object that has a IMixedRealityControllerPoseSynchronizer

@StephenHodgson
Copy link
Contributor Author

StephenHodgson commented Sep 14, 2018

Please feel free to take this and change it up to better fit what your needs are, open a PR on my branch, or open a new PR with your own take, that tries to synchronize the pose in this way.

@keveleigh
Copy link
Contributor

keveleigh commented Sep 14, 2018

To clarify, back to my scenario a few comments up, if I have a brand new cube prefab and I add a solver to it, where do I get an existing reference to a pose synchronizer?

}
}
}
public TrackedObjectType TrackedObjectForSecondTransform => secondSolverHandler.TrackedObjectType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with expression-bodied members, but doesn't this remove the setter? SolverHandlers need a public setter so they can be set to follow non-tracker objects (e.g, any random game object) at runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can still set any transform to track, this is just a read only value of the currently tracked transform's type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. "secondTransformOverride" didn't show up in the diff, so I got the two mixed up.

But I guess that prompts a similar question. If this becomes read only, how does gameplay logic tell the solver to start tracking a motion controller again? It has to find the proper motion controller in the scene and override the TransformTarget? That seems like an undesirable complication.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see how that would be useful.

@StephenHodgson
Copy link
Contributor Author

Added a DNM as this is just an example.

@StephenHodgson StephenHodgson deleted the mrtk-SolverSynchonization branch September 16, 2018 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants