SKPhysicsJointSpring Frequency & Damping in Swift

What is the difference between dampingand frequencyproperties SKPhysicsJointSpring?

The code I have is

var spring = SKPhysicsJointSpring.jointWithBodyA(
            body1.physicsBody,
            bodyB: body2.physicsBody,
            anchorA: body1.position,
            anchorB: body2.position)
spring.frequency = 1.8
spring.damping = 0.5
self.physicsWorld.addJoint(spring1)

body1.physicsBody?.dynamic = false
body2.physicsBody?.dynamic = true

In which range of values ​​do frequencythey dampingfall out so that they springact naturally?

+4
source share
2 answers

The answer depends on what you consider "natural."

Damping means that spring will dissipate energy with every swing and eventually calm down.

Zero damping means that the mass attached to spring will oscillate forever.

Such a system usually has three constants associated with it:

  • mass m (lbm)
  • spring k (lbf/in)
  • c

, f ^ 2 = k/m.

spring "", .

+3

spring, . spring. , 4.0 9.0. 0.0001 , !

: 0.0. frequency == 0.0 spring .

0

All Articles