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

BugFix: ObjectCollection doesn't behave as expected with non-zero rotation. #2526

Closed
lordlycastle opened this issue Jul 31, 2018 · 4 comments
Labels
Legacy (HoloToolkit) Issues specific to the HoloToolkit product UX Controls - General

Comments

@lordlycastle
Copy link

Overview

Go to object collection example scene, change the rotation of one of the parents and click update. The objects will be facing is incorrect direction when you choose Sphere or Cylinder.

Expected Behavior

The collection should be facing as is set in editor.

Actual Behavior

The collection does not face the correct transform.

Steps to reproduce

(Links to sample github project preferred)
ObjectCollectionExample

Unity Editor Version

2017.4.4.1

Mixed Reality Toolkit Release Version

2017.0.0

Fix

I have the fix but creating a pull request is a pain in the bottom (I wanna help, not learn 10 new things), especially since I can't even find the file in repo. Anyways if you wanna be the hero of the hour find ObjectCollection.cs and change lines 287, 294, 326 and 332 from:

 NodeList[i].transform.rotation = Quaternion.LookRotation(newRot);

to:

NodeList[i].transform.LookAt(transform);

And you wanna be the knight in shining armour go ahead is remove that newRot variable if it's not being used.

Note: the lines #s might be slightly difference, I made a few more changes.

@lordlycastle
Copy link
Author

Actually this fix only works with 1 row. Aw well.

@lordlycastle
Copy link
Author

Okay I have the solution for reals now.

In cases of Sphere and Cylinder surface type with FaceOrigin and FaceOriginReverse orientation type change the rotation to localRotation.

// NodeList[i].transform.rotation= Quaternion.LookRotation(newRot);
NodeList[i].transform.localRotation = Quaternion.LookRotation(newRot);

@Ecnassianer
Copy link
Contributor

Ecnassianer commented Aug 1, 2018

This sounds like one of the bugs I fixed in #2227
PR: Ecnassianer@9454011

It's in 2017.4.1.0, which I think is stabilizing for release right now. My changes add a bunch of other new features to collection as well if you want to check them out.

@david-c-kline david-c-kline added Legacy (HoloToolkit) Issues specific to the HoloToolkit product Investigate UX Controls - General labels Aug 1, 2018
@keveleigh
Copy link
Contributor

Sounds like this was fixed in the most recent HTK release. Please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Legacy (HoloToolkit) Issues specific to the HoloToolkit product UX Controls - General
Projects
None yet
Development

No branches or pull requests

4 participants