You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > Damped Spring

19.10.2 Damped Spring

spring = physics.DampedSpring(a, b, anchr1, anchr2, restLength,
                              stiffness, damping)

Parameter

Type

Description

a

in physics.Body

First Body

b

in physics.Body

Second Body

anchr1

in physics.Vect

Anchor point to first Body

anchr2

in physics.Vect

Anchor point to second Body

restLength

in number

The distance the spring wants to maintain between its Bodies

stiffness

in number

The spring constant

damping

in numbe

How soft to make the damping of the spring

spring

out physics.DampedSpring

New DampedSpring

Defined much like a SlideJoint. restLength is the distance the spring wants to be, stiffness is the spring constant, and damping is how soft to make the damping of the spring.

Accessors

Type

setAnchr1, anchr1

physics.Vect

setAnchr2, anchr2

physics.Vect

setRestLength, restLength

number

setStiness, stiness

number

setDamping, damping

number

Introduced in platform.apiLevel = '2.0'