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

Fixing a bug the causes FaceOrigin collections to face the wrong direction when collections are rotated (and some bonuses) TAKE 2 #2246

Merged
merged 24 commits into from
Jun 12, 2018

Conversation

Ecnassianer
Copy link
Contributor

I dug myself into a githole in that other branch. I gave up trying to revert my reverts of merges of merges and just put my changes in a new branch. Sorry for making you check it twice. It should have all the changes I made in response to previous review feedback. The only bit we should be waiting for is @paseb to weigh in on the RadialMapping() question. I'll poke him in person tomorrow.

image


This is a pull request for the completion of my proposal:
#2227

Eric Carter and others added 20 commits May 30, 2018 19:11
…face the wrong direction when collecitons are rotated. Incidentally adds Radial collections.

Previously collections with FaceOrigin selected as their Orientation Type which were not perfectly vertical would align their elements in crazy ways. This commit fixes this, but slightly changes the meaning of FaceOrigin so elements always face the origin, even if that means angling the element up or down to face the origin. This could be considered a breaking change, since all existing FaceOrigin object collections will change behavior. This is particularly true of Cylinder collections which are FaceOrigin orientation.  They can be returned to the old behavior by switching to FaceCenterAxis, which keeps elements aligned with the collection's up vector. FaceCenterAxis also works well with spheres.

In the process I also consolidated all the orientation switch statements into a single function that handles the orientation on all objection collections.

Bringing these changes over also necessitated bringing in @paseb 's addition of Radial collections, that make cool fan-like things. Bonus feature!

Co-Authored-By: Patrick Sebring <[email protected]>
getting master June18 dev into this fork
Update from upstream repo microsoft/MixedRealityToolkit-Unity@june18_dev
Copy link
Contributor

@keveleigh keveleigh left a comment

Choose a reason for hiding this comment

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

Conditional approval, pending @paseb's response to @StephenHodgson's inquiries pasted in the PR body.

@paseb
Copy link

paseb commented Jun 8, 2018

@StephenHodgson, I couldn't add directly to the comments but here my responses to the above comments. Radial mapping represents a radial menu so the grid source is not what is being used though there's no really need to make a new vector so assigning it directly is fine. Since this is a single relative axis rotation gimbal lock isn't an issue. If we were going to do any multi-axis rotations we should be using matrix transforms.

@keveleigh
Copy link
Contributor

Cool, so it looks like addressing the "update source vs new vector creation" concern is all that's needed here for approval.


/// <summary>
/// Margin between objects horizontally.
/// </summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

Summary tags should be above the public properties not the attributes for the private fields

centerAxis = Vector3.Project(node.transform.position - this.transform.position, this.transform.up);
pointOnAxisNearestNode = this.transform.position + centerAxis;
node.transform.rotation = Quaternion.LookRotation(node.transform.position - pointOnAxisNearestNode, this.transform.up);

Copy link
Contributor

Choose a reason for hiding this comment

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

a couple of extra lines before breaks.

{
Radius = radius >= 0 ? Radius : radius;

Vector3 newPos = new Vector3(0f, 0f, (Radius/Rows) * row);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just assign the vector instead of creating a new one?

Copy link
Contributor

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

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

see comments

Copy link
Contributor

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

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

great work!

@keveleigh keveleigh merged commit aeec3a0 into microsoft:june18_dev Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants