2.1 Manual Errata

Under 8.7 Prismatic Joints :

Quote:
jointDef.motorForce = 1.0f;


instead of
Quote:
jointDef.maxMotorForce = 1.0f;


😉
4.3 Circle Shapes

b2CircleShape circle;
circle.m_p.Set(1.0f, 2.0f, 3.0f); // b2Vec3 used instead of b2Vec2
circle.m_radius = 0.5f;

On manual m_p is b2Vec2 but b2Vec3 is documented.
circle.m_p.Set( 1.0f, 2.0f, 3.0f ) ;


I have just started learning box2d from yesterday and found mostly older version ( Box2d 2.0 ) articles on web. But i learned 2.1 has good features so i am keeping it up.

Thank you for such a nice physics package.
;^)
manual.pdf Box2D 2.1.2, page 44, 9.4 Contact Filtering

Code:
class MyContactListener : public b2ContactListener
{
public:
void BeginContact(b2Contact* contact)
{ // handle begin event }
void EndContact(b2Contact* contact)
{ // handle end event }
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold)
{ // handle pre-solve event }
void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse)
{ // handle post-solve event }
};


Should be

Code:
class MyContactListener : public b2ContactListener
{
public:
void BeginContact(b2Contact* contact)
{ /* handle begin event */ }
void EndContact(b2Contact* contact)
{ /* handle end event */ }
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold)
{ /* handle pre-solve event */ }
void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse)
{ /* handle post-solve event */ }
};


🤓
In chapter 10, Ray Casts section:
Quote:
You can use ray casts to do line-of-site checks
Should be "line-of-sight".
6.2 Fixture Creation

Section: Density
Line: The mass of a body is automatically adjusted when you ......

Nothing after you word. The statement is incomplete.
There is an issue with the example of a revolute joint's lifetime on page 34.

Chapter 8.3 Joint Factory

Here's an example of the lifetime of a revolute joint:
Code:
b2RevoluteJointDef jointDef;
jointDef.body1 = myBody1;
jointDef.body2 = myBody2;
jointDef.anchorPoint = myBody1->GetCenterPosition();
b2RevoluteJoint* joint = myWorld->CreateJoint(&jointDef);
... do stuff ...
myWorld->DestroyJoint(joint);
joint = NULL;



It took a rather long time to find the answer to this problem, but it would appear that joints cannot be created in this manner.
Instead they must be created like this.

b2RevoluteJoint* joint = (b2RevoluteJoint*)myWorld->CreateJoint(&jointDef);
In the API documentation for b2World::GetContactList() (API/classb2_world.html):
Quote:
Warning:
contacts are
...are what?
Code:
jointDef.body1 = myBody1;
jointDef.body2 = myBody2;


In the manual, under gear joints, I see this code, but the constructor makes assumptions about the bodies on the joints from the b2GearJointDef and does not use the bodies from b2JointDef.
Thanks all. I have incorporated your feedback. I'll start a new thread once 2.2 is out.
listen to me carefully.....I want to tell you something about helicopter ahh!!!!you can buy rc ,too.i would like to see you>>>



------------------------------------------------------------------
Rc Hobby|Rc Helicopter|Buy Rc Helicopter Parts

Original thread: https://box2d.org/forum/viewtopic.php?t=4767