WeldJoint

The WeldJoint glues two bodies together keeping a constant relative angle. More...

Import Statement: import
Inherits:

Joint

Properties

Detailed Description

The WeldJoint glues two bodies together keeping a referenceAngle. You need to specify local anchor points where the bodies are attached and the relative body angle (referenceAngle property). The position of the anchor points is important for computing the reaction torque.

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

Property Documentation

dampingRatio : real

The damping ratio. 0 = no damping, 1 = critical damping. The default value is 0.


frequencyHz : real

The mass-spring-damper frequency in Hertz. The default value is 0.

Typically the frequency should be less than a half the frequency of the PhysicsWorld::timeStep. So if you are using a 60Hz time step, the frequency of the distance joint should be less than 30Hz. The reason is related to the Nyquist frequency.


localAnchorA : point

The local anchor point relative to the Joint::bodyA center in pixels.

The default is (0, 0), which means the center of Joint::bodyA.


localAnchorB : point

The local anchor point relative to the Joint::bodyB center in pixels.

The default is (0, 0), which means the center of Joint::bodyB.


referenceAngle : real

The bodyB angle minus bodyA angle in the reference state in degrees. The default is 0.

Note: Changing the referenceAngle at runtime has no effect. It is only read at initialization time and cannot be changed later.


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