New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box2d wheel fixes #24

Merged
merged 7 commits into from Jan 8, 2012

Conversation

Projects
None yet
2 participants
@harningt
Copy link
Contributor

harningt commented Jan 8, 2012

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?

@patrickmeehan

This comment has been minimized.

Copy link
Member

patrickmeehan commented Jan 8, 2012

Thanks for these fixes. The intent behind unit conversions was to let scripters/designers better align Box2D units with world units while still respecting Box2D's optimal ranges for performance. My implementation of it has been pretty slapdash, so I really appreciate your help.

patrickmeehan added a commit that referenced this pull request Jan 8, 2012

@patrickmeehan patrickmeehan merged commit a0f968c into moai:master Jan 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment