-
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
Bounding Box and App Bar not working as expected for Rectangular Holograms #2042
Comments
I have the same problem. I use a regular gameobject and, if it is longer than usual, the AppBar goes to inside of my gameobject, that is, inside of the bounding box. Is there already some approach for this problem? Thanks. |
One thing you can do to get over that is, through a custom script through which based on Object's Y rotation, you can change the APP bar's Z offset so that the App Bar doesn't go into or far away from Game object......I'm sure there will be more stable fix to this which i guess would be updated shortly....! |
Yeah! I am creating a script to fix the problem. The reason for which I wrote to this post was because I hoped that there would be an easier solution for this problem. Thank you for your prompt reply. |
Even with that custom script, one issue you may encounter is, even though you are changing z offset based on object's rotation, the app bar may goes into weird position or disappear when the user starts to rotate around the hologram, as the original system changes the app bar orientation even on user's head movement and head orientation angle, |
Sorry for the late reply. Unfortunately I cannot create a custom class. I create a GameObject dynamically and when it is displayed in my scene, the AppBar is created with it. AppBar takes some seconds to be created and, when it is displayed in the scene, it goes to inside of my object. Therefore, I need to spend that time so that I can calculate the distance between the initial point of my GameObject and AppBar. I know that I can calculate that distance and set the Z offset so that the AppBar goes to outside of my GameObject. However, it is not real, that is, I would like that the Z offset of the AppBar could be calculated before it is created with my GameObject, but it is not possible because I would not know the distance. For that reason, I am waiting for the problem to be solved. |
@johnppella is looking into this. Thanks! |
@Cris21395 If that's the problem, the possible solution would be to enter into the play mode and manually adjust the Zoffset in Appbar in inspector until the App bar come out of the gameobject and note down the zoffset value and exit from play mode and entering the noted down Zoffset value to Appbar Prefab in Project Folder, so next time the object's gets instantiated, the app bar should be appearing fine |
You are right, but I cannot do that. Due to the fact that I create holograms dynamically, they can have a different length so this solution does not solve my problem. Thanks anyway. |
OK, if you creating a lot of them, then that's definitely a problem, but if you are dealing with a bunch of holograms , you could just duplicate the AppBar prefabs with corresponding App Bar assigned to holograms. |
Hello, I faced the same problem recently and i fixed it in the AppBar.cs script. You need to change a few things in the FollowingBoundingBox function. First of all, i normalized each forwards vector. Then in the for loop, you don't want to use the MaxScaleXY value for two reasons:
My fix is below, it's a quick fix, that probably required enhancement :
Important part is about maxXYScale being replaced by ((i %2 == 0)?-scale.z/2.0f : -scale.x / 2.0f)) This, i believe, solved the issue for me. NB: I changed a lot of things in my Bounding Box Rig behaviour so i can only rotate object along Y axis and them along XZ plane. This fix may cause trouble if you rotate along X or Z. |
Thank you so much!! It worked for me. I tried to solve the problem with a different script because I did not want to change the the AppBar.cs, but it was very hard since you cannot access to some important variables. Also, thanks for the explanation; you have explained it very clear. |
I tried to use this fix (#2042) in my project. It seems I can't scale an object with the appbar moving along when the mesh is chlidren of the BoundingBoxRig anymore. Project 1 : This is the result : Project 2 : I have the fixed BoundingBoxRig on an object named "GameObject". I am scaling the children "Cube". this is the result : It seems the new BoundingBoxRig does not take children in account. Am I right ? |
I change the function AddAABoundingBoxes in BoundingBoxHelper to this :
because points[X] wasn't setted correctly when using .Set() but it does not correct the issue I mentionned earlier |
So you merged this even though the BoundingBoxRig does not take children in account ? 😮 Beside in the merged code, I see that .Set() is still used in the AddAABoundingBoxes function |
@ThomasAstrakhan Are you saying the original issue wasn't fixed by #2212? Please reopen if so. Otherwise, if there are new problems, please file new issues. |
@keveleigh I think the Bounding Box and App Bar are not working as expected for Rectangular Holograms. @coolpad007 think the expected behavior is
And if you look at my comment ( #2042 (comment) ) it doesn't fit the expected behavior. I can't reopen this issue. |
Yesterday I updated my project with 2017.4.1.0 release. The solution for the problem of the AppBar does not work as expected. The movement is not good and it does not rotate aorund the hologram. I had to use the solution provided by @Cyhzault and make some changes to the script so that the icons appear correctly. As @ThomasAstrakhan said, it would be grate if this issue could be reopened so that the problem can be solved. |
@cre8ivepark @johnppella Hello. Is there any news about this issue ? |
Please upgrade to MRTK v2 as a lot of these are addressed in the updated version. |
Overview
The Bounding box for hololens works very well for squared holograms like a chair, cube, small toy but for something like truck which length is very large compared to it's breadth, the app bar is far away from the hologram, as it takes the maximum scale side as start.
When Scaling up or scaling down the truck, the app bar goes in to the truck when scaled town very small, and moves very far from hologram when scaled up.
It would be really helpful if i get a solution for this quick, I'm short on time, please respond quickly, Thank you!
Expected Behavior
When Scaling up or down a hologram , the app bar should adjust according to that so that the bar doesn't goes in to hologram or don't more far way.
Actual Behavior
when the Bounding box Rig is attached to hologram which is of rectangular shape like a big truck, while scaling up or down or while rotating the hologram with sphere handles, the app bar gets into hologram or moves too far away from hologram
Steps to reproduce
Import a truck like model which is of rectangular shape whose length is relatively very large to it's breadth , add bounding box rig to it and you can experience the above mentioned issues
Unity Editor Version
Unity2017.2.1f1
Mixed Reality Toolkit Release Version
The text was updated successfully, but these errors were encountered: