moai/moai-beta — pull request #24 by harningt (2012-01-08 06:30:28+00:00)
Title: Box2d wheel fixes

Many fixes applied to the Box2D WheelJoint type to:

* fix API mistakes such as
* a 'get' API setting value and returning nothing / top object on stack (the joint object itself)
* a 'set' API returning a value and not setting anything
* many off-by-one Lua stack errors causing defaults to be consumed
* better match up units properly to what box2d interprets

Seeing the unit match-up problem, I may make another patch for fixing the other joint errors - basically:
* "Torque" as measured by box2d is in N-m - a measure of newtons * meters (which could technically require / unitsToMeters - squared)
* Speed when measuring 'wheels' and 'spinning' things is in radians, so in the Moai API - we'd need Rad->Deg, not distance
* Ratios have no units - so no conversion

this business of not using Box2D's conversion complicates many many things.. any particular reason why?