Jun 12, 2009 at 10:45 PM
Edited Jun 12, 2009 at 10:48 PM
Thanks to both danthekilla and yobiv for the suggestions.
@danthekilla: The inactivity controller chapter is my fault. I simply forgot to write it before releasing 2.0. It seems like I'm alone on the project for the next couple of months, so I might not get around updating the manual because I'm
buzy preparing for the next version.
As for your solution; good idea - it could improve stacking alot and I would like to see a quick demo of your results. However, it only applies to the case that you have horisontal stacking. The perfect inactivity controller is generic in the sense that
it does not know about orientation, it only cares if the geom is moving or not. This should be implemented directly into the engine and bodies are per default at sleep, and only wake up when force / impulse is applied to them.
Right now we have a separate controller that have no way of hooking into the engine more than it already does. It can also give a lot of overhead when running the controller (noticable when you have a lot of disabled bodies or several active areas in your
game). To combat this it would be better to use the broad phase algorithms instead of a O(n^2) complexity implementation. I am working on getting a good sleeping/resting bodies implementation working for the next release.
@yobiv: The Vertices.CreateSimpleRectangle() was added to support SAT a little better. It creates 4 vertices instead of the 16 vertices in Vertices.CreateRectangle(). SAT only need the vertices that makes up the shape (having more degrades
performance) - Distance grid needs a lot more.
I will make sure that GeomFactory.CreateSimpleRectangleGeom() is added to the next release.
As for the numberOfGeoms - When you supply 15, it will try and separate the geometry into 15 geometries. This is needed for concave polygons. In the next release, I will focus on making it fully transparent to the user. It will detect a concave polygon and
split it into a (approx) optimial number of geomtries.
Setting it to 0 to have unlimited geometries does not make sense to me. Can you elaborate a little on that?
maxGeoms does sound more logical. Thanks for the suggestion.