A constraint is something that describes how two bodies interact with each other. (how they constrain each other). Constraints can be simple joints that allow bodies to pivot around each other like the bones in your body, or they can be more abstract like the gear joint or motors.
This submodule contain all the constraints that are supported by pymunk.
Chipmunk has a good overview of the different constraint on youtube which works fine to showcase them in pymunk as well. http://www.youtube.com/watch?v=ZgJJZTS0aMM
Bases: object
Base class of all constraints.
You usually don’t want to create instances of this class directly, but instead use one of the specific constraints such as the PinJoint.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Like a damped spring, but works in an angular fashion
The first of the two bodies constrained
The second of the two bodies constrained
How soft to make the damping of the spring.
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
The relative angle in radians that the bodies want to have
The spring constant (Young’s modulus).
Set the torque function
func(self, relative_angle) -> torque
Bases: pymunk.constraint.Constraint
A damped spring
The first of the two bodies constrained
The second of the two bodies constrained
How soft to make the damping of the spring.
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
The distance the spring wants to be.
The spring constant (Young’s modulus).
Bases: pymunk.constraint.Constraint
Keeps the angular velocity ratio of a pair of bodies constant.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Similar to a pivot joint, but one of the anchors is on a linear slide instead of being fixed.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Keeps the anchor points at a set distance from one another.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Simply allow two objects to pivot about a single point.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Works like a socket wrench.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Constrains the relative rotations of two bodies.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Bases: pymunk.constraint.Constraint
Keeps the relative angular velocity of a pair of bodies constant.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
The desired relative angular velocity
Bases: pymunk.constraint.Constraint
Like pin joints, but have a minimum and maximum distance. A chain could be modeled using this joint. It keeps the anchor points from getting to far apart, but will allow them to get closer together.
The first of the two bodies constrained
The second of the two bodies constrained
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Get the last impulse applied by this constraint.
The maximum rate at which joint error is corrected. Defaults to infinity
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity