My favorites | Sign in
Project Logo
                
Search
for
Updated Mar 07, 2009 by sirkne
Documentation  
Documentation Page

Help

For now, the main documentation will be kept on the Box2D wiki.

Please feel free to discuss your ideas and/or problems in the forums, also.

Manual

The original Box2D manual has been ported to Python and mostly updated for the latest version. You can find it here.

Basic API documentation is available thanks to epydoc, here. It's hardly user-friendly, so unless you know what you're looking for, chances are the testbed examples are still your best bet.

Version Numbers

The version numbers follow the main Box2D releases (currently 2.0.1) with a release number attached. For example, 2.0.1b3 is based on Box2D release 2.0.1 and is the third release of the bindings.

Starting Box2D 2.0.2b1, the version number of the source code is available in Box2D:

import Box2D
Box2D.__version__      # '2.0.2b1'
Box2D.__version_info__ # (2,0,2,1)

Changes

2.0.2b1 (2/25/2009)

Since 2.0.2b0, there have been a good deal of changes to pybox2d:

There are several code-breaking features that you might run into:

  • The library is now called Box2D (and not the cumbersome Box2D2)
  • Controllers now follow the factory style (see the buoyancy test for more information)
  • b2Distance updated (see here if this affects you)
  • b2Body.GetShapeList() used to return only first shape, now returns actual list
  • b2World.GetBodyList/Joint() used to return only first body, now returns actual list
  • All occurences of the ugly 'm_*' have been removed. This might require some changes in your code, since this applies to all b2Joint.m_* and others, not just testbed stuff.

The following are the additional properties added. Most are just for convenience and make the definition (e.g., b2ShapeDef) symmetric with the output (e.g., b2Shape). Ones in bold are changeable; the rest are read-only:

b2Worldgravity, jointList, bodyList, groundBody, worldAABB, doSleep
b2Shapefilter, friction, restitution, density
b2Jointtype, userData, body1, body2, collideConnected
b2CircleShape radius, localPosition
b2PolygonShapevertices, coreVertices, normals
b2Body massData, position, angle, linearDamping, angularDamping, allowSleep, isSleeping, IsRotationFixed, isBullet, angularVelocity, linearVelocity, shapeList

(later SVN versions add support for changing damping, fixedRotation, and shape isSensor)

Basic epydoc documentation is now available here. The testbed is no longer included in the installer, so please download it separately here.

2.0.2b0 (10/23/2008)

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.

2.0.1b4 (6/1/2008)

2.0.1b3 (5/7/2008)


Sign in to add a comment
Hosted by Google Code