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

Simple changes to the math package for convenience #2018

Merged
merged 9 commits into from Jun 25, 2014

Conversation

@JesseTG
Copy link
Contributor

JesseTG commented Jun 22, 2014

This is mostly for me to get my feet wet in contributing to LibGDX. I haven't done many pull requests before.

Anyway, this PR is nothing huge. It just does the following:

  • Adds equals() and hashCode() to Circle, Ellipse, GridPoint2, GridPoint3, Ray, Segment, and Sphere.
  • Added methods for circumference and area (and their 3D equivalents where applicable) to Circle, Ellipse, Sphere, and Rectangle
  • Changed Rectangle's uses of NumberUtils.floatToIntBits() to NumberUtils.floatToRawIntBits().
  • Added len() and len2() to Segment
  • Added a constructor for Ellipse that accepts a Circle (not vice versa)

I don't believe this is a breaking change (sans the usual negligible probabilities that come with changing the hash function).

JesseTG added 3 commits Jun 22, 2014
@JesseTG JesseTG changed the title Added some small methods to Circle Simple changes to the math package for convenience Jun 22, 2014
@nooone

This comment has been minimized.

Copy link
Contributor

nooone commented Jun 23, 2014

I think it makes reviewing PRs a lot easier if the one creating the PR writes a quick summary about what the changes are, why they were made and which use cases they cover.

With this quick overview in mind it is much easier for the reviewer to understand your changes.

@JesseTG

This comment has been minimized.

Copy link
Contributor Author

JesseTG commented Jun 23, 2014

Gotcha. Will do right now.

EDIT: Done.

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented Jun 25, 2014

Cool, thanks!

badlogic added a commit that referenced this pull request Jun 25, 2014
Simple changes to the math package for convenience
@badlogic badlogic merged commit ee40431 into libgdx:master Jun 25, 2014
@RotaruDan

This comment has been minimized.

Copy link
Contributor

RotaruDan commented on gdx/src/com/badlogic/gdx/math/Rectangle.java in 9740a54 Jun 25, 2014

2 * (w + h) ?

This comment has been minimized.

Copy link
Member

davebaol replied Jun 25, 2014

of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.