Thanks for pointing out the user support angle, Boris. Indeed I hadn't thought of that. But I guess this port will most likely remain experimental anyway. I might use it for my game at first and switch to JBox2D later if I start missing new features or improvements.
I'm still not done with cleaning the API (and internals too), but most of what I've done or thinking about doing is:
* instead of filling objects passed in as parameters, return newly created objects (sometimes tuples)
* use Scala's Option[T] instead of null to indicate optional stuff (where it makes sense)
* replacing the small data holder classes with tuples and case classes (immutable if possible)
* making things private where possible (haven't looked much into it yet)
* no getters and setters -- Scala has uniform access for fields and methods. So i'm using only fields, but writing a Scala-style setter/getter where necessary (which are accessed the same way as the field)
* implicit conversions from tuples to vectors and matrices, extension methods for floats
these allow to write stuff like: body.linearVelocity = 0.5f * (1.0f, 2.0f), although they incur a small performance penalty
* replacing linked list where the list is kept in the items themselves with Scala collections (I haven't figured out the best ones to use yet). If this turns out to perform badly, I'm thinking of going back to the old behavior, but writing a generic DoublyLinkedListItem trait that can be mixed in to the classes that are in lists so you wouldn't have to reimplement the list functionality everywhere.
* replaced the custom hashtable with Scala's HashMap (will look into other options later)
* replaced the whole contact registers business with a simple pattern match (since it was pretty much hard coded anyway):
Code:
contact = (shape1, shape2) match {
case (s1: Circle, s2: Circle) => CircleContact(s1, s2)
case (s1: Polygon, s2: Circle) => PolygonCircleContact(s1, s2)
case (s1: Polygon, s2: Polygon) => PolygonContact(s1, s2)
...
}
* etc.
ewjordan, I can hopefully compare the performance sometime this week, as of now I still have some bugs that make current comparision pointless.