Skip to content

DynamicsB2JointFriction Dump method has a Pointer Reciever #32

@scirelli

Description

@scirelli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions