Exemple #1
0
 def damped_spring(self, b, anchor1, anchor2, rlen, k, dmp, dt):
     """Apply a spring force between this and body b at anchors anchr1 and 
     anchr2 respectively. k is the spring constant (force/distance), rlen 
     is the rest length of the spring, dmp is the damping constant 
     (force/velocity), and dt is the time step to apply the force over.
     """
     cp.cpDampedSpring(self._body, b._body, anchor1, anchor2, rlen, k, dmp, dt)
Exemple #2
0
 def damped_spring(self, b, anchor1, anchor2, rlen, k, dmp, dt):
     """Apply a spring force between this and body b at anchors anchr1 and 
     anchr2 respectively. 
     
     :Parameters:
         b : `Body`
             The other body
         anchor1 : (x,y) or `Vec2d`
             Anchor point on the first body
         anchor2 : (x,y) or `Vec2d`
             Anchor point on the second body
         k : float
             The spring constant (force/distance)
         rlen : float
             The rest length of the spring
         dmp : float
             The damping constant (force/velocity)
         dt : float
             The time step to apply the force over.
     """
     cp.cpDampedSpring(self._body, b._body, anchor1, anchor2, rlen, k, dmp, dt)
Exemple #3
0
def damped_spring(a, b, anchor1, anchor2, rlen, k, dmp, dt):
    """Apply a spring force between bodies a and b at anchors anchr1 and anchr2
    respectively. k is the spring constant (force/distance), rlen is the rest 
    length of the spring, dmp is the damping constant (force/velocity), and dt 
    is the time step to apply the force over."""
    cp.cpDampedSpring(a._body, b._body, anchor1, anchor2, rlen, k, dmp, dt)