# Difference between revisions of "B2.createPulleyJointDef"

(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Creates and returns a pulley joint definition table with the bodies, anchors, lengths, max leng...") |
|||

Line 7: | Line 7: | ||

<br /> | <br /> | ||

<source lang="lua"> | <source lang="lua"> | ||

− | (table) | + | (table) = b2.createPulleyJointDef(bodyA,bodyB,groundAnchorAx,groundAnchorAy,groundAnchorBx,groundAnchorBy,anchorAx,anchorAy,anchorBx,anchorBy,ratio) |

</source> | </source> | ||

− | '''bodyA | + | '''bodyA''': (b2.Body) the first attached body ''''''<br/> |

− | '''bodyB | + | '''bodyB''': (b2.Body) the second attached body ''''''<br/> |

− | '''groundAnchorAx | + | '''groundAnchorAx''': (number) the x coordinate of the first ground anchor in world coordinates. This point never moves. ''''''<br/> |

− | '''groundAnchorAy | + | '''groundAnchorAy''': (number) the y coordinate of the first ground anchor in world coordinates. This point never moves. ''''''<br/> |

− | '''groundAnchorBx | + | '''groundAnchorBx''': (number) the x coordinate of the second ground anchor in world coordinates. This point never moves. ''''''<br/> |

− | '''groundAnchorBy | + | '''groundAnchorBy''': (number) the y coordinate of the second ground anchor in world coordinates. This point never moves. ''''''<br/> |

− | '''anchorAx | + | '''anchorAx''': (number) the x coordinate of the world anchor point of bodyA ''''''<br/> |

− | '''anchorAy | + | '''anchorAy''': (number) the y coordinate of the world anchor point of bodyA ''''''<br/> |

− | '''anchorBx | + | '''anchorBx''': (number) the x coordinate of the world anchor point of bodyB ''''''<br/> |

− | '''anchorBy | + | '''anchorBy''': (number) the y coordinate of the world anchor point of bodyB ''''''<br/> |

− | '''ratio | + | '''ratio''': (number) the pulley ratio, used to simulate a block-and-tackle ''''''<br/> |

'''Returns''' (table) A new pulley joint definition table<br/> | '''Returns''' (table) A new pulley joint definition table<br/> |

## Revision as of 10:17, 23 August 2018

**Available since:** Gideros 2011.6

### Description

Creates and returns a pulley joint definition table with the bodies, anchors, lengths, max lengths, and ratio using the world anchors.

(Please refer to b2.World:createJoint function for more information about all the information needed to create a pulley joint).

```
(table) = b2.createPulleyJointDef(bodyA,bodyB,groundAnchorAx,groundAnchorAy,groundAnchorBx,groundAnchorBy,anchorAx,anchorAy,anchorBx,anchorBy,ratio)
```

'*bodyA : (b2.Body) the first attached body '*

'

*bodyB*

**: (b2.Body) the second attached body '**'

*groundAnchorAx*

**: (number) the x coordinate of the first ground anchor in world coordinates. This point never moves. '**'

*groundAnchorAy*

**: (number) the y coordinate of the first ground anchor in world coordinates. This point never moves. '**'

*groundAnchorBx*

**: (number) the x coordinate of the second ground anchor in world coordinates. This point never moves. '**'

*groundAnchorBy*

**: (number) the y coordinate of the second ground anchor in world coordinates. This point never moves. '**'

*anchorAx*

**: (number) the x coordinate of the world anchor point of bodyA '**'

*anchorAy*

**: (number) the y coordinate of the world anchor point of bodyA '**'

*anchorBx*

**: (number) the x coordinate of the world anchor point of bodyB '**'

*anchorBy*

**: (number) the y coordinate of the world anchor point of bodyB '**'

*ratio*

**: (number) the pulley ratio, used to simulate a block-and-tackle '****Returns**(table) A new pulley joint definition table