Skip to content

differ 1.3.0 stable

Choose a tag to compare

@ruby0x1 ruby0x1 released this 19 Sep 02:37
· 13 commits to master since this release

This release was quite a while in progress!

The goal of this release is as follows :

  • Reduce the usage of Vector internally, simplifying the code to primitives
  • Remove allocations, myriads of them the old code had that carried over
  • Add ways to reuse allocated results for efficiency when querying
  • Add more test/example cases
  • Expose the alternative polygon vs shape overlaps to make better choices based on movement
  • Move the code more forward to be internally consistent and maintainable
  • Fix the bugs with the rays and add more useful infinite flags

All of this was achieved, with the following changes.

  • Refactor continued clean up
    • remove all allocations in SAT2D, except for results if not provided
    • refactor away internal uses of Vector
    • remove superfluous use of Vector in the API
      • ShapeDrawer: drawLine,drawPoint
      • Collision.pointInPoly
  • Added Ray infinite mode instead of boolean
    • Not infinite
    • Infinite from start position
    • Infinite in both directions
  • Added Rays test in usage0
  • Added ShapeCollision/RayCollision/RayIntersection
    • added clone(), copy_from(other), reset()
  • Added differ.math.Util
    • removes internal SAT2D use of the Vector class
  • Added into argument for all internal and external calls
    • this reuses the existing instance for the result
    • all calls will always reset the collision result
    • all direct calls still return null as "no result"
    • added Results<T> results cache helper
    • all plural calls return Results<T>
  • Fixed Bug in testCircleVsPolygon
    • When testing polygon vs circle values were flipped/wrong
  • Fixed Bug in rayVsRay with a negative overlap
  • Removed Common util class, it's internal to SAT2D and simplified now
  • Removed drawVector in ShapeDrawer, wasn't used (use drawLine if needed)