Joint

Abstract base class of all joints types. More...

Properties

Detailed Description

The Joint is not usable by itself, but the base class of all derived joint types. These are MouseJoint, DistanceJoint, RevoluteJoint and PrismaticJoint.

For all joints to work properly, bodyA and bodyB property needs to be set. An exception is the MouseJoint, which does not require any of them to be set.

The collideConnected property can be set to enable collision handling of the two connected bodies.

For a comprehensive documentation of all joints see the Box2D documentation at http://www.box2d.org/manual.html#_Toc258082974.

This page has a nice Box2D demo on the top of the page, where you can try different joint types directly in the browser: http://blog.allanbishop.com/box2d-2-1a-tutorial-part-2-joints/

Property Documentation

bodyA : Body

The first attached body. Is required for all joints to be set except for MouseJoint.


bodyB : Body

The second attached body. Is required for all joints to be set except for MouseJoint.


collideConnected : bool

Set this to true to enable collision handling and response between the two connected bodies of this joint. By default, it is set to false.


jointType : JointType

The concrete type of this joint, one of the

 enum JointType {
        UnknownJoint,
        RevoluteJoint,
        PrismaticJoint,
        DistanceJoint,
        PulleyJoint,
        MouseJoint,
        GearJoint,
        WheelJoint,
        WeldJoint,
        FrictionJoint,
        RopeJoint,
        MotorJoint
    }

constants.


Videos

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support