<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> __docformat__ = "<STR_LIT>" <EOL> import ctypes as ct <EOL> from . import _chipmunk as cp <EOL> from . import _chipmunk_ffi as cpffi <EOL> class Constraint ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , constraint = None ) : <EOL> self . _constraint = constraint <EOL> self . _ccontents = self . _constraint . contents <EOL> def _get_max_force ( self ) : <EOL> return self . _ccontents . maxForce <EOL> def _set_max_force ( self , f ) : <EOL> self . _ccontents . maxForce = f <EOL> max_force = property ( _get_max_force , _set_max_force , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_error_bias ( self ) : <EOL> return self . _ccontents . errorBias <EOL> def _set_error_bias ( self , error_bias ) : <EOL> self . _ccontents . errorBias = error_bias <EOL> error_bias = property ( _get_error_bias , _set_error_bias , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_max_bias ( self ) : <EOL> return self . _ccontents . maxBias <EOL> def _set_max_bias ( self , max_bias ) : <EOL> self . _ccontents . maxBias = max_bias <EOL> max_bias = property ( _get_max_bias , _set_max_bias , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_impulse ( self ) : <EOL> return cpffi . cpConstraintGetImpulse ( self . _constraint ) <EOL> impulse = property ( _get_impulse , <EOL> doc = """<STR_LIT>""" ) <EOL> a = property ( lambda self : self . _a , <EOL> doc = """<STR_LIT>""" ) <EOL> b = property ( lambda self : self . _b , <EOL> doc = """<STR_LIT>""" ) <EOL> def activate_bodies ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _a . activate ( ) <EOL> self . _b . activate ( ) <EOL> def _set_bodies ( self , a , b ) : <EOL> self . _a = a <EOL> self . _b = b <EOL> a . _constraints . add ( self ) <EOL> b . _constraints . add ( self ) <EOL> def __del__ ( self ) : <EOL> if cp is not None : <EOL> cp . cpConstraintFree ( self . _constraint ) <EOL> class PinJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , anchr1 = ( <NUM_LIT:0> , <NUM_LIT:0> ) , anchr2 = ( <NUM_LIT:0> , <NUM_LIT:0> ) ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpPinJointNew ( a . _body , b . _body , anchr1 , anchr2 ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _pjc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpPinJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_anchr1 ( self ) : <EOL> return self . _pjc . anchr1 <EOL> def _set_anchr1 ( self , anchr ) : <EOL> self . _pjc . anchr1 = anchr <EOL> anchr1 = property ( _get_anchr1 , _set_anchr1 ) <EOL> def _get_anchr2 ( self ) : <EOL> return self . _pjc . anchr2 <EOL> def _set_anchr2 ( self , anchr ) : <EOL> self . _pjc . anchr2 = anchr <EOL> anchr2 = property ( _get_anchr2 , _set_anchr2 ) <EOL> def _get_dist ( self ) : <EOL> return self . _pjc . dist <EOL> def _set_dist ( self , dist ) : <EOL> self . _pjc . dist = dist <EOL> distance = property ( _get_dist , _set_dist ) <EOL> class SlideJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , anchr1 , anchr2 , min , max ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpSlideJointNew ( a . _body , b . _body , anchr1 , anchr2 , min , max ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _sjc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpSlideJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_anchr1 ( self ) : <EOL> return self . _sjc . anchr1 <EOL> def _set_anchr1 ( self , anchr ) : <EOL> self . _sjc . anchr1 = anchr <EOL> anchr1 = property ( _get_anchr1 , _set_anchr1 ) <EOL> def _get_anchr2 ( self ) : <EOL> return self . _sjc . anchr2 <EOL> def _set_anchr2 ( self , anchr ) : <EOL> self . _sjc . anchr2 = anchr <EOL> anchr2 = property ( _get_anchr2 , _set_anchr2 ) <EOL> def _get_min ( self ) : <EOL> return self . _sjc . min <EOL> def _set_min ( self , min ) : <EOL> self . _sjc . min = min <EOL> min = property ( _get_min , _set_min ) <EOL> def _get_max ( self ) : <EOL> return self . _sjc . max <EOL> def _set_max ( self , max ) : <EOL> self . _sjc . max = max <EOL> max = property ( _get_max , _set_max ) <EOL> class PivotJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , * args ) : <EOL> """<STR_LIT>""" <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> self . _constraint = cp . cpPivotJointNew ( a . _body , b . _body , args [ <NUM_LIT:0> ] ) <EOL> elif len ( args ) == <NUM_LIT:2> : <EOL> self . _constraint = cp . cpPivotJointNew2 ( a . _body , b . _body , args [ <NUM_LIT:0> ] , args [ <NUM_LIT:1> ] ) <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _pjc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpPivotJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_anchr1 ( self ) : <EOL> return self . _pjc . anchr1 <EOL> def _set_anchr1 ( self , anchr ) : <EOL> self . _pjc . anchr1 = anchr <EOL> anchr1 = property ( _get_anchr1 , _set_anchr1 ) <EOL> def _get_anchr2 ( self ) : <EOL> return self . _pjc . anchr2 <EOL> def _set_anchr2 ( self , anchr ) : <EOL> self . _pjc . anchr2 = anchr <EOL> anchr2 = property ( _get_anchr2 , _set_anchr2 ) <EOL> class GrooveJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , groove_a , groove_b , anchr2 ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpGrooveJointNew ( a . _body , b . _body , groove_a , groove_b , anchr2 ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _pjc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpGrooveJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_anchr2 ( self ) : <EOL> return self . _pjc . anchr2 <EOL> def _set_anchr2 ( self , anchr ) : <EOL> self . _pjc . anchr2 = anchr <EOL> anchr2 = property ( _get_anchr2 , _set_anchr2 ) <EOL> def _get_groove_a ( self ) : <EOL> return self . _pjc . grv_a <EOL> groove_a = property ( _get_groove_a ) <EOL> def _get_groove_b ( self ) : <EOL> return self . _pjc . grv_b <EOL> groove_b = property ( _get_groove_b ) <EOL> class DampedSpring ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , anchr1 , anchr2 , rest_length , stiffness , damping ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpDampedSpringNew ( a . _body , b . _body , anchr1 , anchr2 , rest_length , stiffness , damping ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _dsc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpDampedSpring ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_anchr1 ( self ) : <EOL> return self . _dsc . anchr1 <EOL> def _set_anchr1 ( self , anchr ) : <EOL> self . _dsc . anchr1 = anchr <EOL> anchr1 = property ( _get_anchr1 , _set_anchr1 ) <EOL> def _get_anchr2 ( self ) : <EOL> return self . _dsc . anchr2 <EOL> def _set_anchr2 ( self , anchr ) : <EOL> self . _dsc . anchr2 = anchr <EOL> anchr2 = property ( _get_anchr2 , _set_anchr2 ) <EOL> def _get_rest_length ( self ) : <EOL> return self . _dsc . restLength <EOL> def _set_rest_length ( self , rest_length ) : <EOL> self . _dsc . restLength = rest_length <EOL> rest_length = property ( _get_rest_length , _set_rest_length , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_stiffness ( self ) : <EOL> return self . _dsc . stiffness <EOL> def _set_stiffness ( self , stiffness ) : <EOL> self . _dsc . stiffness = stiffness <EOL> stiffness = property ( _get_stiffness , _set_stiffness , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_damping ( self ) : <EOL> return self . _dsc . damping <EOL> def _set_damping ( self , damping ) : <EOL> self . _dsc . damping = damping <EOL> damping = property ( _get_damping , _set_damping , <EOL> doc = """<STR_LIT>""" ) <EOL> class DampedRotarySpring ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , rest_angle , stiffness , damping ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpDampedRotarySpringNew ( a . _body , b . _body , rest_angle , stiffness , damping ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _dsc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpDampedRotarySpring ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_rest_angle ( self ) : <EOL> return self . _dsc . restAngle <EOL> def _set_rest_angle ( self , rest_angle ) : <EOL> self . _dsc . restAngle = rest_angle <EOL> rest_angle = property ( _get_rest_angle , _set_rest_angle , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_stiffness ( self ) : <EOL> return self . _dsc . stiffness <EOL> def _set_stiffness ( self , stiffness ) : <EOL> self . _dsc . stiffness = stiffness <EOL> stiffness = property ( _get_stiffness , _set_stiffness , <EOL> doc = """<STR_LIT>""" ) <EOL> def _get_damping ( self ) : <EOL> return self . _dsc . damping <EOL> def _set_damping ( self , damping ) : <EOL> self . _dsc . damping = damping <EOL> damping = property ( _get_damping , _set_damping , <EOL> doc = """<STR_LIT>""" ) <EOL> def _set_torque_func ( self , func ) : <EOL> """<STR_LIT>""" <EOL> def _impl ( _ , relative_angle ) : <EOL> return func ( self , relative_angle ) <EOL> self . _torque_func_callback = cp . cpDampedRotarySpringTorqueFunc ( _impl ) <EOL> self . _dsc . springTorqueFunc = self . _torque_func_callback <EOL> torque_func = property ( fset = _set_torque_func , <EOL> doc = _set_torque_func . __doc__ ) <EOL> class RotaryLimitJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , min , max ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpRotaryLimitJointNew ( a . _body , b . _body , min , max ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _rlc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpRotaryLimitJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_min ( self ) : <EOL> return self . _rlc . min <EOL> def _set_min ( self , min ) : <EOL> self . _rlc . min = min <EOL> min = property ( _get_min , _set_min ) <EOL> def _get_max ( self ) : <EOL> return self . _rlc . max <EOL> def _set_max ( self , max ) : <EOL> self . _rlc . max = max <EOL> max = property ( _get_max , _set_max ) <EOL> class RatchetJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , phase , ratchet ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpRatchetJointNew ( a . _body , b . _body , phase , ratchet ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _dsc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpRatchetJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_angle ( self ) : <EOL> return self . _dsc . angle <EOL> def _set_angle ( self , angle ) : <EOL> self . _dsc . angle = angle <EOL> angle = property ( _get_angle , _set_angle ) <EOL> def _get_phase ( self ) : <EOL> return self . _dsc . phase <EOL> def _set_phase ( self , phase ) : <EOL> self . _dsc . phase = phase <EOL> phase = property ( _get_phase , _set_phase ) <EOL> def _get_ratchet ( self ) : <EOL> return self . _dsc . ratchet <EOL> def _set_ratchet ( self , ratchet ) : <EOL> self . _dsc . ratchet = ratchet <EOL> ratchet = property ( _get_ratchet , _set_ratchet ) <EOL> class GearJoint ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , phase , ratio ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpGearJointNew ( a . _body , b . _body , phase , ratio ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _dsc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpGearJoint ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_phase ( self ) : <EOL> return self . _dsc . phase <EOL> def _set_phase ( self , phase ) : <EOL> self . _dsc . phase = phase <EOL> phase = property ( _get_phase , _set_phase ) <EOL> def _get_ratio ( self ) : <EOL> return self . _dsc . ratio <EOL> def _set_ratio ( self , ratio ) : <EOL> self . _dsc . ratio = ratio <EOL> ratio = property ( _get_ratio , _set_ratio ) <EOL> class SimpleMotor ( Constraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , rate ) : <EOL> """<STR_LIT>""" <EOL> self . _constraint = cp . cpSimpleMotorNew ( a . _body , b . _body , rate ) <EOL> self . _ccontents = self . _constraint . contents <EOL> self . _dsc = cp . cast ( self . _constraint , ct . POINTER ( cp . cpSimpleMotor ) ) . contents <EOL> self . _set_bodies ( a , b ) <EOL> def _get_rate ( self ) : <EOL> return self . _dsc . rate <EOL> def _set_rate ( self , rate ) : <EOL> self . _dsc . rate = rate <EOL> rate = property ( _get_rate , _set_rate , <EOL> doc = """<STR_LIT>""" ) </s>
