Skip to content
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

DynamicsB2JointFriction Dump method has a Pointer Reciever #32

Open
scirelli opened this issue Nov 21, 2020 · 0 comments
Open

DynamicsB2JointFriction Dump method has a Pointer Reciever #32

scirelli opened this issue Nov 21, 2020 · 0 comments

Comments

@scirelli
Copy link

I'm a noob to box2d (and Go), I was following a C++ example on creating joints.
In the example:

b2xxxJoint* joint = (b2xxxJoint*)world->CreateJoint( &jointDef );

They cast the returned joint to the one they wanted created. Doing the same in Go gives a compilation error

impossible type assertion:
box2d.B2FrictionJoint does not implement box2d.B2JointInterface (Dump method has pointer receiver)

var jointDef box2d.B2FrictionJointDef = box2d.MakeB2FrictionJointDef()
jointDef.BodyA = ball1
jointDef.BodyB = ball2
joint := world.CreateJoint(&jointDef).(box2d.B2FrictionJoint)

Looking at the source and you can see it's a pointer receiver B2JointFrictio Line 282

Some of the other joints are not B2JointDistance Line 337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant