PulleyJoint

Keeps the total distance between a body, 2 points and another body constant. More...

Import Statement: import
Inherits:

Joint

Properties

Methods

Detailed Description

The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio * length2 <= constant The force transmitted is scaled by the ratio.

Warning: the pulley joint can get a bit squirrelly by itself. They often work better when combined with prismatic joints. You should also cover the the anchor points with static shapes to prevent one side from going to zero length.

Property Documentation

groundAnchorA : point

The first anchor point on the ground, in world coordinates in pixels.

Needs to be specified.


groundAnchorB : point

The second anchor point on the ground, in world coordinates in pixels.

Needs to be specified.


lengthA : real

Length from localAnchorA to groundAnchorA, in pixels.

If not specified, the current length is used at the time of joint creation.


lengthB : real

Length from localAnchorB to groundAnchorB, in pixels.

If not specified, the current length is used at the time of joint creation.


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.


ratio : real

The pulley ratio, used to simulate a block-and-tackle. Used in the equation lengthA + ratio * lengthB <= constant

The default value is 1.0.


Method Documentation

point getReactionForce(real inv_dt)

Returns the reaction force, in kg*pixels/second^2 for a timestep of length inv_dt, in seconds.

For the Parameter inv_dt, World::timeStep can be used.


real getReactionTorque(real inv_dt)

This is always 0, since a MouseJoint applies only force and no torque.


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