CreatePulleyJoint
Description
Creates a pulley joint between two sprites. The anchor points are world space coordinates that attach the joint to the sprite, the anchor points do not have to be on the sprite's center, or anywhere near the sprite, but this point will become the new center of rotation for the time the sprite is attached to the pulley. The ground points are where the pulley rope will attach to the imaginary pulleys, and will remain fixed for the life of the joint, they need not be in the same location. The ratio value determines the gear ratio between the two sides of the pulley, for example a value of 2 would mean that sprite 1 moves at twice the speed of sprite 2, but will experience half the force applied to sprite 2.
Definition
CreatePulleyJoint( iJointIndex, iSpriteIndex1, iSpriteIndex2, gnd1x, gnd1y, gnd2x, gnd2y, a1x, a1y, a2x, a2y, ratio, colConnected )
void agk::CreatePulleyJoint( uint32_t iJointIndex, uint32_t iSpriteIndex1, uint32_t iSpriteIndex2, float gnd1x, float gnd1y, float gnd2x, float gnd2y, float a1x, float a1y, float a2x, float a2y, float ratio, int colConnected )
Parameters
- iJointIndex - The ID to use for this joint.
- iSpriteIndex1 - The ID of the first sprite to join.
- iSpriteIndex2 - The ID of the second sprite to join.
- gnd1x - The x coordinate of the ground point for sprite 1.
- gnd1y - The y coordinate of the ground point for sprite 1.
- gnd2x - The x coordinate of the ground point for sprite 2.
- gnd2y - The y coordinate of the ground point for sprite 2.
- a1x - The x coordinate of the anchor point for sprite 1.
- a1y - The y coordinate of the anchor point for sprite 1.
- a2x - The x coordinate of the anchor point for sprite 2.
- a2y - The y coordinate of the anchor point for sprite 2.
- ratio - The ratio between the two sides of the pulley.
- colConnected - Set whether the two sprites connected by the joint can collide with one another, 0=no, 1=yes.