-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Proposal: In Between Solver that keeps an object between two tracked objects/transforms #2228
Comments
Also fixing a bug where SolverHandlers can attach to a default handedness controller before their Handedness is updated. |
@Ecnassianer, |
I added in a couple changes for the May release that align with things you mention here.
I saw this same issue (or at least, something extremely similar) when I was implementing the controller pointing rays, so I updated ControllerFinder to wait until This allows apps to instantiate ControllerFinders at runtime and update their handedness before they try to attach. I'm not sure if this will properly bubble up and solve the issue in SolverHandler, but it sounds similar.
I also added a method called Since SolverHandler is a ControllerFinder, you should be able to take advantage of these (or perhaps your changes supersede mine or they can live side-by-side). Overall, thanks for all this feedback and the contributions! |
Shoot, I think I missed your commit by a few hours! XD I think we're essentially doing the same thing. The biggest difference is in mine the reattach work happens in the setter of Handedness. It looks like ChangeHandedness() needs to be called each time Handedness is updated? I added it to the accessor because I think there are no circumstances where you want to update Handedness and not immediately do the work to find a new controller. Am I overlooking a reason they should be independent? If you're curious, here are mine: I'll pull your may changes into my local branch and get them to mingle nicely. |
I much prefer your way of doing it, so all the dev has to do is change handedness and it "just works". I can't think of a good reason for them to be independent, so we should likely deprecate my method in favor of yours. This Issue also reminded me that I had an in-progress refactor of Solver/SolverHandler from a few months ago, specifically addressing:
I'll start cleaning up my work and updating it with the latest code, then I can make sure it works well with your proposed updates here. |
Pull Request here: |
Overview
My team needed a solver that keeps an object in between two tracked objects. I'd like to pull this code into the June 18 release.
My implementation creates a second solverhandler (public class AdditionalSolverHandler : SolverHandler) and adds it to the gameobject at runtime. This second solverhandler updates its TransformTarget, which is used by SolverInBetween as one of the two end points. It could be used by other solver types in the future; any number of AdditionalSolverHandlers is supported.
In the process, I fixed a few bugs, particularly with the custom inspectors. Solvers can now be switched to other tracked objects while playing in editor or at runtime via script. It also adds an offset and rotation to solver handlers so you can track a virtual point near by/rotated around an actual tracked object.
I have an updated version of the SolverHandler that I've used for testing and it is 17.7x better than the old one, so I'll replace the old one with that. The only downside is my new map requires motion controllers. The upside is the old map was pretty busted without motion controllers. It will be included in this PR.
One thing that will be lacking in this pull request is a refactor of the Solver and SolverHandler's attachment coroutine. I'd like to do that in a later pull request, but for now it leaves a bit of a mess around Solvers and SolverHandlers talking to each other unnecessarily when they reattach to new tracked objects.
The text was updated successfully, but these errors were encountered: