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

Exposing Transforms.rotationMatrixFromPositionVelocity #8934

Merged
merged 4 commits into from
Jun 8, 2020
Merged

Exposing Transforms.rotationMatrixFromPositionVelocity #8934

merged 4 commits into from
Jun 8, 2020

Conversation

easternmotors
Copy link
Contributor

@easternmotors easternmotors commented Jun 8, 2020

Also added tests for Transforms.rotationMatrixFromPositionVelocity

NOTE: I wasn't able to figure out how to get the tests to pass since Transforms.rotationMatrixFromPositionVelocity sometimes return 0 or -0 for it's 0 values. I ended up just using the Matrix3.abs function for now but if there is a better way to handle this let me know.

Handles bullet 3 from #8927

… tests for Transforms.rotationMatrixFromPositionVelocity
@cesium-concierge
Copy link

Thanks for the pull request @easternmotors!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@easternmotors
Copy link
Contributor Author

Updated CHANGES.md

@easternmotors easternmotors changed the title #8927: Exposing Transforms.rotationMatrixFromPositionVelocity Exposing Transforms.rotationMatrixFromPositionVelocity Jun 8, 2020
Cartesian3.UNIT_Y
);
var expected = new Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0);
// using Matrix3.abs to fix the 0/-0 comparisons
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to replace this with toEqualEpsilon throughout. For example:

expect(matrix).toEqualEpsilon(expected, CesiumMath.EPSILON14);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome that works. Makes me feel a lot better

@mramato
Copy link
Contributor

mramato commented Jun 8, 2020

Thanks @easternmotors, just the one comment to address the abs usage and hopefully this will be good to go. Thanks.

@mramato
Copy link
Contributor

mramato commented Jun 8, 2020

Thanks!

@mramato mramato merged commit ac7be10 into CesiumGS:master Jun 8, 2020
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.

3 participants