Commit Graph

113 Commits

Author SHA1 Message Date
Michael Bayne ec70c7f0e1 [maven-release-plugin] prepare for next development iteration 2011-09-20 13:31:19 -07:00
Michael Bayne d4cc17c355 [maven-release-plugin] prepare release pythagoras-1.1 2011-09-20 13:31:14 -07:00
Michael Bayne 5e344f9511 Avoid an extra division (and field update) in setScaleX/Y. Thanks Tim! 2011-09-15 16:24:29 -07:00
Michael Bayne dd64ca194f Erm, we need our classes as well as our source. 2011-09-09 17:18:45 -07:00
Michael Bayne 4f2ad2493c Nix that, ooo-build uses maven.deploy.repo so that's what we must use. 2011-09-09 16:51:54 -07:00
Michael Bayne 0059edfd21 Tidied up Ant build. 2011-09-09 16:35:05 -07:00
Michael Bayne f32a735215 Merge remote-tracking branch 'tconkling/master'
Conflicts:
	src/main/java/pythagoras/f/AbstractCircle.java
	src/main/java/pythagoras/f/ICircle.java
2011-09-09 10:10:44 -07:00
Michael Bayne c6321e4573 Version of circle code specialized on double. 2011-09-09 10:08:49 -07:00
Michael Bayne 2753a9523d Small tidying. 2011-09-09 10:07:34 -07:00
Tim Conkling c82f38fa97 It helps to get the math right 2011-09-09 10:05:11 -07:00
Tim Conkling 1916a7e8e7 Circle implementation 2011-09-09 10:05:02 -07:00
Michael Bayne 6a4c46114e Don't publish to the Maven repository from SBT.
We need SBT to publish to the local Ivy repository, so that we can reference
snapshots from other SBT projects. Pulling a snapshot from the local Maven
repository just doesn't seem to work with SBT+Ivy.
2011-09-06 15:51:32 -07:00
Michael Bayne 42d4353788 Various Vector enhancements.
- Moved Vector.direction to Point.direction as that makes more sense. If you
  want to know the angle of the vector between two points, you should do that
  on points, not vectors.

- Added Vector.angle() which returns the angle of the vector (in polar
  coordinates), which matches Vector.length() which returns the magnitude of
  the vector (in polar coordinates).

- Added Vectors.fromPolar to create a vector from polar coordinates, and added
  Vector.setLength and Vector.setAngle to set the one whilst preserving the
  other.
2011-09-02 15:55:05 -07:00
Michael Bayne 49eafa5653 Vector.angle -> Vector.angleBetween. 2011-09-02 15:23:13 -07:00
Michael Bayne 0644fc6f59 Added Point.subtract, for creating a vector from endpoints. 2011-09-02 15:21:17 -07:00
Michael Bayne ffd2f10b24 Changed Vector.mult to Vector.scale and clarified the javadocs.
As Tim points out, vector multiplication implies dot or cross products. These
methods are scaling, not multiplying. Cross product coming in a future commit.
2011-09-02 15:15:06 -07:00
Tim Conkling 59416dca9e It helps to get the math right 2011-09-02 13:43:55 -07:00
Tim Conkling ad7472bde2 Circle implementation 2011-09-02 13:41:18 -07:00
Michael Bayne e8b0a664d6 Specify that we want to 1.6-compatible class files. I'm building with 1.7 these
days. w00t!
2011-08-25 11:27:19 -07:00
Michael Bayne 67e2737548 Filter the super-source directory from the SBT build. 2011-08-15 07:34:02 -07:00
Michael Bayne 047bc49c31 Exclude the super-source directory when building the code. We also no longer
use src/main/resources.
2011-08-15 07:26:55 -07:00
Michael Bayne cc1c1d3f51 Use super-source to provide our GWT-specialized Platform.java. 2011-08-13 09:32:34 -07:00
Michael Bayne 41a3eff538 Build file tweaks. 2011-08-12 16:22:36 -07:00
Michael Bayne c8d591c8a2 Converted the float bits to double since they've substantially evolved. 2011-08-12 11:00:36 -07:00
Michael Bayne 0d82811da9 Split FloatMath into MathUtil and FloatMath.
FloatMath contains only shim methods that convert double Math methods to float,
but extends MathUtil so that library users can easily access everything via one
class. MathUtil is used internally so that I can convert pythagoras.f to
pythagoras.d with a few sed expressions. And MathUtil would be what users of
pythagoras.d would want to use for their lerping, clamping and stringifying.
2011-08-12 10:57:53 -07:00
Michael Bayne 41f62de088 getX -> x (in both the literal and algebraic sense).
In anticipation of the saying of nay, I offer this: these are value classes,
and in a civilized language, I wouldn't have setters either. "foo.x = x" would
call a setter method over which I had control. However, rather than throwing my
hands up and saying "Gee, I have to have verbose setters, so I guess I better
have verbose getters," I say, "I'll take what I can get."

Methods that verb can be verbs, and we can all agree to understand that methods
that are nouns are getters. foo.width() does not width my foo, it's my foo's
width. foo.invert() inverts up my foo, it is not some attribute of my foo's
nonsensically named invert. I don't want to add my foo's getWidth and
getHeight, I want to add my foo's width and height. So why should I have to
type get over and over again just because I want to protect myself from future
representation change? (Or in this case, to offer immutable views of my value
classes.)
2011-08-12 10:19:37 -07:00
Michael Bayne a537b6627d Fixed typo. 2011-08-05 16:47:39 -07:00
Michael Bayne 5e7529d969 Fixed bug in getTy(). 2011-08-05 16:45:49 -07:00
Michael Bayne e7cfc6c350 Fixed translate() methods. 2011-08-05 16:45:32 -07:00
Michael Bayne e21872e686 GLSL uses column-major matrices, so let's use those as well to avoid confusing
mismatch.
2011-08-05 13:56:13 -07:00
Michael Bayne 1cb8b8bff5 Better error reporting on test failure. 2011-08-05 13:55:57 -07:00
Michael Bayne 1936e20380 Fixed FloatMath.toString(), added tests. 2011-07-29 11:00:20 -07:00
Michael Bayne 92f6e0932f Added an SBT build. 2011-07-22 15:56:43 -07:00
Michael Bayne 102fb340b7 Improved float value formatting. 2011-07-19 09:33:17 -07:00
Michael Bayne d3b91156b0 Removed IEEERemainder for GWT compatibility. 2011-07-12 07:27:02 -07:00
Michael Bayne e90f70a0f6 Implemented affine inverse transforms without creating an intermediate inverted
transform.
2011-07-11 14:41:34 -07:00
Michael Bayne ede16ab724 Added ZERO. 2011-07-07 16:08:24 -07:00
Michael Bayne 3206fde292 Moved AffineTransform multiplication methods into Transforms so that
performance sensitive callers can make use of them.
2011-07-07 13:43:43 -07:00
Michael Bayne d241c06771 Use ooojavac to compile test sources as well. 2011-07-07 10:54:41 -07:00
Michael Bayne 1d7ef7cdf7 Added methods to concatenate a translation, rotation or scale directly onto an
existing transform.
2011-07-06 14:13:21 -07:00
Michael Bayne 6eda0bb25e Might as well just lerp directly here. 2011-07-06 13:19:19 -07:00
Michael Bayne 6ee9bcda7e Reworked intro, added credit to Clyde, from whence much of this transform code
originated (though it is now heavily transformed, ha!).
2011-07-06 13:13:52 -07:00
Michael Bayne aa0fe0f87c Great big transform revamp.
We now have a Transform interface and a bevy of implementations of varying
generality: identity, rigid body, uniform scaling, non-uniform scaling, and
affine.

Along the way, Vector was added, APIs were tidied up, bits were twiddled, but
no platonic shapes were harmed.
2011-07-06 13:08:12 -07:00
Michael Bayne b6f87af8a0 Added Vector and friends, and Transform interface. 2011-07-05 09:29:36 -07:00
Michael Bayne 339ea761d1 Use FloatMath for our float math. 2011-07-05 09:06:32 -07:00
Michael Bayne b1c9545f04 Fixed typo. 2011-07-05 09:02:16 -07:00
Michael Bayne cbacc4ddac Utility methods and constants for single-precision floating point math. 2011-07-05 09:01:30 -07:00
Michael Bayne eb56f394ae Javadoc and clone() improvements. 2011-07-01 16:59:32 -07:00
Michael Bayne 71debc6a17 Moved static factory methods to top of class. 2011-07-01 16:34:05 -07:00
Michael Bayne fd11be72ee Documented AffineTransform. 2011-07-01 16:33:13 -07:00