Commit graph

50 commits

Author SHA1 Message Date
Richard Davey
fc8bff7b9e jshint fix. 2015-08-07 01:41:59 +01:00
Richard Davey
614b84e2ea * Line.rotateAround allows you to rotate a Line around the given coordinates (in world space)
* Point.rotate uses a faster and simpler rotation function when no distance argument is specified.
* Line.rotate used a calculation method which resulted in the line growing (or shrinking) in length over time, the more it was rotated. The new method never changes the lines length.
2015-08-07 01:35:31 +01:00
photonstorm
f15fe6706c All undefined argument checks were changed from if (typeof x === 'undefined') to if (x === undefined) removing the typeof check and saving some bytes across the codebase in the process. 2015-07-22 10:37:15 +01:00
photonstorm
732b80813e Line.rotate allows you to rotate a line by the given amount around its center point. 2015-06-13 05:20:43 +01:00
photonstorm
5f9bff0e8b Clarified the documentation for Point.rotate and fixed all the examples. 2015-06-13 05:02:07 +01:00
luckylooke
1939efd1c1 Copypaste typo
`Point.setTo(2, 2)` to `Point.set(2, 2)`
2015-05-20 14:21:35 +02:00
photonstorm
a69e53f901 Copyright date change. 2015-02-25 03:36:23 +00:00
photonstorm
e100f2f528 Added in type properties. 2015-02-17 16:38:07 +00:00
photonstorm
689501c15c Phaser.Point.angleSq removed. It didn't work so any code relying on it would be broken, and it's unclear what it was meant for (thanks @nextht #1396) 2015-01-05 13:00:07 +00:00
Paul
dab8772de0 Documentation - consistency updates
- Updated `readOnly` doclet to `readonly`

- `array` refined to `type[]`, where such information was immediately
determinable.

- Updated {Any}/{*} to {any}; {...*} is standard exception

- Udated {Object} to {object}
2014-11-30 04:03:35 -08:00
Paul
a6d2da2a8a Math/Utils - various cleanup and deprecations/moves
There are no known breaking changes.

- Timer
  - Uses standard Math.min/Math.max (it's better 2, 3 items).

- Math
  - Updated documentation
  - Marked various Math functions as deprecated, proxying as appropriate
    - Array-based functions -> ArrayUtils
    - RNG-based functions -> Utils
    - Updated core-usage
    - floor/ceil should not be used (alternatives provided)
  - Altered for some equivalencies
  - Also fixes some assorted issues
  - Marked a few internal functions as private

- Utils
  - Moved polyfills to their own file for better visibility
  - Moved array functions to ArrayUtils and marked proxies as deprecated

- Created Phaser.ArrayUtils for array-related functions

- polyfills moved to their own file
  - Functions given function names
  - Added Math.trunc
2014-11-09 16:17:18 -08:00
photonstorm
d9c4890882 Point.floor will Math.floor both the x and y values of the Point.
Point.ceil will Math.ceil both the `x` and `y` values of the Point.
2014-11-04 23:57:21 +00:00
Richard Davey
abe6f5ace2 Point.parse updated to allow either/or x/y setting and default values.
Point.parse will return a new Point object based on the x and y properties of the object given to Point.parse (thanks @codevinsky #1198)
2014-09-23 22:23:01 +01:00
Jeremy Dowell
29dd09fdf6 added: Phaser.Point.parse
static method that will take an object of any kind and return a new point based on the x & y properties of that object.

optional x & y property names can also be supplied
2014-09-17 14:23:28 -05:00
photonstorm
20551f9129 Lots of jsdocs fixes ready for the new doc generator. 2014-09-16 17:35:08 +01:00
Richard Davey
e8ca3a8d7b Merge pull request #1130 from beeglebug/feature/clone-consistency
Improved consistency of clone methods on geometry classes
2014-08-28 01:40:51 +01:00
beeglebug
7ae5657113 extra null check on output to match rectangle 2014-08-21 22:44:40 +01:00
Sandeep Nambiar
b25e2bd782 Sign Error 2014-08-13 05:49:39 +05:30
Sandeep Nambiar
daade10ecc Should fix the Error in rotation 2014-08-13 05:19:21 +05:30
Richard Davey
570e8acabb Joystick updates. 2014-05-07 18:10:13 +01:00
Richard Davey
281e84ee9b Start of the Virtual Joystick plugin.
Fixes to Point.angle.
2014-05-07 16:35:08 +01:00
photonstorm
f15c17ba41 jshint fixes 2014-04-27 12:10:29 +01:00
photonstorm
6e5415fc31 Point.interpolate - Interpolates the two given Points, based on the f value (between 0 and 1) and returns a new Point. 2014-04-27 11:16:06 +01:00
photonstorm
8dd67ea6ec Point.dot - get the dot product of two Point objects.
Point.cross - get the cross product of two Point objects.
Point.cross - get the cross product of two Point objects.
Point.perp - make the Point perpendicular (90 degrees rotation)
Point.rperp - make the Point perpendicular (-90 degrees rotation)
Point.normalRightHand - Right-hand normalize (make unit length) a Point.
Point.angle - Returns the angle between this Point object and another object with public x and y properties.
Point.angleSq - Returns the angle squared between this Point object and another object with public x and y properties.
Point.getMagnitudeSq - Calculates the length squared of the Point object.
Point.project - Project two Points onto another Point.
Point.projectUnit - Project two Points onto a Point of unit length.
Point.multiplyAdd - Adds two 2D Points together and multiplies the result by the given scalar.
Point.negative - Creates a negative Point.
2014-04-27 11:09:57 +01:00
photonstorm
2cba2a0e2b Point.dot - get the dot product of two Point objects.
Point.cross - get the cross product of two Point objects.
Point.cross - get the cross product of two Point objects.
Point.perp - make the Point perpendicular (90 degrees rotation)
Point.rperp - make the Point perpendicular (-90 degrees rotation)
2014-04-26 20:35:31 +01:00
photonstorm
6ace9e6031 Made jsdocs clear that Point.set/setTo 2nd parameter is optional (fix #743) 2014-04-22 02:02:56 +01:00
photonstorm
f3922002a1 Circle.distance used an incorrect Math call if you wanted a rounded distance value (thanks @OpherV, fix #745)
Point.distance used an incorrect Math call if you wanted a rounded distance value (thanks @OpherV, fix #745)
2014-04-22 01:52:24 +01:00
photonstorm
b6ad11701e Various jshint fixes. 2014-04-01 01:30:20 +01:00
Lewis Lane
1d1e47d68d Update Point.js 2014-03-31 16:03:18 +01:00
Lewis Lane
14b16fb583 Update Point.js 2014-03-31 16:01:35 +01:00
Lewis Lane
c5629008e9 Updated Phaser.Point.centroid function.
Performance boosts and bugfix with averaging.
2014-03-31 16:00:55 +01:00
Lewis Lane
5e2e520e26 Added Phaser.Point.centroid function.
Added static Phaser.Point.centroid function to calculate the centroid or midpoint of an array of points.
2014-03-31 15:21:40 +01:00
Christian Wesselhoeft
04d88b6c35 Fix jshint issues in src/geom 2014-03-25 14:56:05 -07:00
Christian Wesselhoeft
61f18b675c Trim trailing whitespace. 2014-03-25 14:56:04 -07:00
photonstorm
08e5f18257 Fixed some doc typos.
You can now pass a physicsConfig object with the game constructor that is given to p2.World, allowing you to set the broadphase, etc.
2014-02-19 03:51:48 +00:00
photonstorm
e88b10323a Updated Phaser geometry classes so they over-ride the PIXI native ones, means we can do away with a whole bunch of over-rides and object changes in Sprite, etc. 2014-02-06 12:29:07 +00:00
photonstorm
0896c2fac7 Updating copyright year and README. 2014-02-05 16:54:59 +00:00
photonstorm
ce4cf531d4 Added class constructors, fixed Stripshader, added relative Tween example and updated Tween source. 2013-12-30 16:54:00 +00:00
photonstorm
299115ca5d The entire Phaser library has been updated to match the new JSHint configuration. 2013-11-25 04:40:04 +00:00
photonstorm
13a2cc2feb Updating all files to adhere to the JSHint settings and fixing lots of documentation errors on the way. 2013-11-25 03:13:04 +00:00
Richard Davey
6a24d6116b Lots of renderTexture updates and examples added 2013-11-13 06:49:24 +00:00
Stuart Lee
903c2e73fa added getMagnitude, setMagnitude, normalize and isZero methods to Point 2013-10-31 14:11:03 +00:00
photonstorm
83a00862be Lots of new examples and updates. 2013-10-09 04:31:08 +01:00
Richard Davey
852e82d0ca More docs. 2013-10-02 12:11:22 +01:00
Richard Davey
ca113b85aa More docs coming on. 2013-10-01 16:39:39 +01:00
Richard Davey
305b12d76b Adding docs. 2013-10-01 15:01:46 +01:00
Richard Davey
e41e35fd09 Fixed an error that stopped 2 tweens from being able to run on the same object. Also refactored a lot of the classes to remove prototype properties and move them to local instance properties. 2013-09-10 20:40:34 +01:00
Richard Davey
99e0934244 More late-night math. 2013-09-01 02:28:51 +01:00
Richard Davey
22847f6ade DebugUtils converted, re-name spaced the Input classes and started on Camera culling. 2013-08-31 21:50:34 +01:00
Richard Davey
89fe2855e4 Fixed a few things in Circle and added the Point object. 2013-08-28 15:58:37 +01:00