A spring with a damper. More...
#import <ChipmunkConstraint.h>
Inherits ChipmunkConstraint.
Public Member Functions | |
(id) | - initWithBodyA:bodyB:anchr1:anchr2:restLength:stiffness:damping: |
Initialize a damped spring between two bodies at the given anchor points. | |
Static Public Member Functions | |
(ChipmunkDampedSpring *) | + dampedSpringWithBodyA:bodyB:anchr1:anchr2:restLength:stiffness:damping: |
Create an autoreleased damped spring between two bodies at the given anchor points. | |
Properties | |
cpVect | anchr1 |
The anchor point on the first body. | |
cpVect | anchr2 |
The anchor point on the second body. | |
cpFloat | restLength |
The length the spring wants to contract or expand to. | |
cpFloat | stiffness |
The young's modulus of the spring. | |
cpFloat | damping |
The amount of viscous damping to apply. |
A spring with a damper.
While a spring is not technically a constraint, the damper is. The spring forces are simply a convenience.
+ (ChipmunkDampedSpring *) dampedSpringWithBodyA: | (ChipmunkBody *) | a | ||
bodyB: | (ChipmunkBody *) | b | ||
anchr1: | (cpVect) | anchr1 | ||
anchr2: | (cpVect) | anchr2 | ||
restLength: | (cpFloat) | restLength | ||
stiffness: | (cpFloat) | stiffness | ||
damping: | (cpFloat) | damping | ||
Create an autoreleased damped spring between two bodies at the given anchor points.
restLength | The length the spring wants to contract or expand to. | |
stiffness | The young's modulus of the spring. | |
damping | The amount of viscous damping to apply. |
- (id) initWithBodyA: | (ChipmunkBody *) | a | ||
bodyB: | (ChipmunkBody *) | b | ||
anchr1: | (cpVect) | anchr1 | ||
anchr2: | (cpVect) | anchr2 | ||
restLength: | (cpFloat) | restLength | ||
stiffness: | (cpFloat) | stiffness | ||
damping: | (cpFloat) | damping | ||
Initialize a damped spring between two bodies at the given anchor points.
restLength | The length the spring wants to contract or expand to. | |
stiffness | The young's modulus of the spring. | |
damping | The amount of viscous damping to apply. |