Hipmunk-0.2.2: A Haskell binding for Chipmunk.

Portabilityportable (needs FFI)
Stabilityprovisional
Maintainerfelipe.lessa@gmail.com

Physics.Hipmunk.Joint

Contents

Description

Joints that constrain bodies.

Synopsis

Joints

data Joint Source

A joint represents a constrain between two bodies. Don't forget to add the bodies and the joint to the space.

Instances

data JointType Source

There are currently four types of joints. When appending a number to a property, we hint that it refer to one of the bodies that the joint is contraining (e.g. anchor2 is the position of the anchor on the second body in its coordinates).

Constructors

Pin

A pin joint connects the bodies with a solid pin. The anchor points are kept at a fixed distance.

Slide

A slide joint is similar to a pin joint, however it has a minimum and a maximum distance.

Pivot

A pivot joint allows the bodies to pivot around a single point in world's coordinates. Both should be already in place.

Fields

pivot :: Position
 
Groove

A groove joint attaches a point on the second body to a groove in the first one.

newJoint :: Body -> Body -> JointType -> IO JointSource

newJoint b1 b2 type connects the two bodies b1 and b2 with a joint of the given type. Note that you should add the Joint to a space.