Chipmunk2D Pro API Reference  6.1.5
 All Classes Functions Variables Typedefs Properties Groups Pages
Instance Methods | Class Methods | Properties | List of all members
ChipmunkDampedSpring Class Reference

A spring with a damper. More...

#import <ChipmunkConstraint.h>

Inherits ChipmunkConstraint.

Instance Methods

(id) - initWithBodyA:bodyB:anchr1:anchr2:restLength:stiffness:damping:
 Initialize a damped spring between two bodies at the given anchor points. More...
 
- Instance Methods inherited from ChipmunkConstraint
(void) - preSolve:
 Override this method to update a constraints parameters just before running the physics each step.
 
(void) - postSolve:
 Override this method to poll values from a constraint each frame after the physics runs. More...
 

Class Methods

(ChipmunkDampedSpring *) + dampedSpringWithBodyA:bodyB:anchr1:anchr2:restLength:stiffness:damping:
 Create an autoreleased damped spring between two bodies at the given anchor points. More...
 
- Class Methods inherited from ChipmunkConstraint
(ChipmunkConstraint *) + constraintFromCPConstraint:
 Get the ChipmunkConstraint object associciated with a cpConstraint pointer. More...
 

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.
 
- Properties inherited from ChipmunkConstraint
cpConstraintconstraint
 Returns a pointer to the underlying cpConstraint C struct.
 
ChipmunkBodybodyA
 The first ChipmunkBody the constraint controls.
 
ChipmunkBodybodyB
 The second ChipmunkBody the constraint controls.
 
cpFloat maxForce
 Maximum force this constraint is allowed to use (defalts to infinity). More...
 
cpFloat errorBias
 The rate at which joint error is corrected. More...
 
cpFloat maxBias
 Maximum rate (speed) that a joint can be corrected at (defaults to infinity). More...
 
cpFloat impulse
 Get the most recent impulse applied by this constraint.
 
ChipmunkSpacespace
 Get the space the body is added to.
 
id data
 An object that this constraint is associated with. More...
 

Detailed Description

A spring with a damper.

While a spring is not technically a constraint, the damper is. The spring forces are simply a convenience.

Method Documentation

+ (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.

Parameters
restLengthThe length the spring wants to contract or expand to.
stiffnessThe young's modulus of the spring.
dampingThe 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.

Parameters
restLengthThe length the spring wants to contract or expand to.
stiffnessThe young's modulus of the spring.
dampingThe amount of viscous damping to apply.

The documentation for this class was generated from the following file: