Thursday, October 23, 2008

2.0.2b0 Released!


With nearly no response from the community, this time-consuming project might end at this version.

I'm also hoping that the OS X installers work well enough for everyone. It took a good amount of time to figure out how to (properly?) release for it.

In any case, here's the changelog:
First release that's not based on a major Box2D release. It combines Box2D SVN r177 and contributions from shaktool (thin line segment) and BorisTheBrave (controllers/buoyancy).

* Thin line segment support (forum post)
* Buoyancy with generic controller support (forum post)
* Pyglet 1.1 testbed (still has some issues. run convert-from-pygame.py to convert the tests from pygame)
* OS X Installer
* Python 2.6 support
* Line joints (see LineJoint test)
* Raycasts (see RayCast test and BoxCutter test)
* TestSegment support
* BreakableBody test (forum post)
* Fixed: == was working, but != comparisons weren't.
* Access to polygon normals, core vertices, etc.
* cvar list fixed
* Off by one bug fixed for vertices

New time step will require a few minor updates to your code:

Old:
world.Step(timeStep, iterationCount)

New:
world.Step(timeStep, velocityIterations, positionIterations)

velocityIterations is usually 10, and positionIterations is usually 8.

Friday, October 10, 2008

pybox2d r86 - Thin Line Segment Shapes

 


Thanks to shaktool, thin line segments are now available for Box2D! I've ported them to pybox2d, which you can see if you use svn r86. It's still in beta in the C++ form, so API changes can be expected.

This is great news for creating platformer games, and even terrain in general. No longer will you have to worry about tesselating non-convex shapes to get the slopes and such that you want. See the new testbed demos,
test_DynamicEdges.py
test_PyramidStaticEdges.py
test_StaticEdges.py

They are very simple to use, also:

(Assuming a b2Body, body, at the origin)
verts = [ (50.0,0.0), (-50.0,0.0) ]
edgeDef = box2d.b2EdgeChainDef()
edgeDef.setVertices(verts)
edgeDef.isALoop = False
body.CreateShape(edgeDef)

Creates a big, static line at the bottom of your world. If you want to make a dynamic one, simply use body.SetMassFromShapes() afterward. However, there are some problems with the dynamic versions (see the forum post)