Commit Graph

31 Commits

Author SHA1 Message Date
MartyMaro
bde26eca15 Prevents trying to create sub-polygons (triangles) with less than 3 non-collinear points when triangulating a polygon
fixes #55
2018-02-08 21:45:08 +01:00
F.H
73a9456bb5 Fixing local variable 2016-01-25 21:06:38 +01:00
Matthias Richter
6bb4ba0e24 Rename intersectionsRay. Less redundancy.
* intersectionsRay() -> intersectionsWithRay()
* intersectsRay() uses results from intersectionsWithRay()
  (Exception: PointShape does it the other way around)
2014-01-24 09:47:13 +01:00
vrld
afc917253c Merge pull request #31 from Ragzouken/intersectionsRay
method to return all intersections, not just the first
2014-01-24 00:33:16 -08:00
Matthias Richter
b362ae8c5f Undo bf35186904: use own triangulation again.
Replaced call to love.math.triangulate() with pure Lua implementation of
Kong's algofirthm.
2014-01-24 09:31:06 +01:00
Mark Wonnacott
b101121d51 new method for shapes :intersectionsRay returns an unordered table of ray intersection t values 2014-01-14 10:33:12 +00:00
Matthias Richter
2d169413dd Assert that Polygon is not intersecting itself 2014-01-13 22:49:45 +01:00
Matthias Richter
bf35186904 Use love.math.triangulate instead of own implementation 2014-01-13 22:49:38 +01:00
Matthias Richter
5d100c703f Adhere to new class commons specs. 2013-07-21 12:51:35 +02:00
Matthias Richter
6c7c17ed9e [Fix #23] polygon:getBBox should be polygon:bbox 2013-02-09 22:07:31 +01:00
Matthias Richter
68de65f22e Fix #19: outcircle not changed when scaling polygon. 2012-07-30 19:27:55 +02:00
Matthias Richter
694cc05024 Fix polygon merging. Add polygon:scale(s, cx, cy).
Polygon merging failed due to invalid computation of shared edge.

polygon:scale(s,cx,cy) scales polygon by factor s wrt point cx,cy.
2012-07-05 17:27:33 +02:00
Matthias Richter
6b23a5c4c4 More numerically stable point-in-triangle test 2012-06-29 12:21:47 +02:00
Matthias Richter
490b8775a2 Remove unpackHelper from polygon.lua 2012-05-19 17:31:19 +02:00
Matthias Richter
c3011ad841 Faster Polygon:unpack() 2012-05-19 12:41:25 +02:00
Matthias Richter
5b12e72aae Switch to light vector module 2012-04-12 16:07:50 +02:00
Matthias Richter
87f964cb43 Fix shape:intersectsRay(). 2012-02-20 13:13:49 +01:00
Matthias Richter
c681391033 Fix triangulation. Use class-commons. Add hash:draw()
Polygon triangulation bug:
In some cases Kongs triangulation algorithm produces triangles
with collinear points. The Polygon constructor removes one of
these and throws an error because there are not enough vertices.
Checking if the current points in a triangulation step are
collinear and discarding those triangles fixes the problem.

Class-commons lets you use any supporting class system as
backend for HC.

Add SpatialHash:draw() for debug purposes.
2012-01-22 00:09:54 +01:00
Matthias Richter
956df262d5 Avoid using module(). Make main module a class. 2011-11-13 14:15:46 +01:00
Matthias Richter
06ae1d0910 Fix polygon rotation. 2011-02-27 14:48:46 +01:00
Matthias Richter
97b470b059 Fix bug: Polygon:contains() fails for rectangles when point left of shape 2011-02-21 17:16:13 +01:00
Matthias Richter
2b83c9f93f More profiling based optimisation 2011-02-07 19:03:19 +01:00
Matthias Richter
5885d10294 Ray intersection returns ray parameter of intersection point 2011-02-07 17:38:44 +01:00
Matthias Richter
da6e772be7 add ray intersection 2011-02-07 00:08:02 +01:00
Matthias Richter
56737e7aa0 Add point location and broad phase 2011-02-06 17:40:06 +01:00
Matthias Richter
4554742579 Hide submodules. 2011-02-06 15:03:21 +01:00
Matthias Richter
ec10437644 Performance tweaks 2011-02-02 21:04:00 +01:00
Matthias Richter
f28685bc16 Make proper lua modules 2011-01-18 18:55:51 +01:00
Matthias Richter
d839b9309c Allow number arguments to move/rotate functions 2011-01-16 19:27:37 +01:00
Matthias Richter
c6d1054354 Work on collision code 2011-01-14 23:25:43 +01:00
Matthias Richter
3ad0242195 Initial commit 2011-01-13 14:38:36 +01:00