φ Famo.us University Famo.us/Angular Docs Help Blog Download
  • core
  • Context
  • ElementAllocator
  • ElementOutput
  • Engine
  • Entity
  • EventEmitter
  • EventHandler
  • Group
  • Modifier
  • OptionsManager
  • RenderNode
  • Scene
  • SpecParser
  • Surface
  • Transform
  • View
  • ViewSequence
  • events
  • EventArbiter
  • EventFilter
  • EventMapper
  • inputs
  • Accumulator
  • GenericSync
  • MouseSync
  • PinchSync
  • RotateSync
  • ScaleSync
  • ScrollSync
  • TouchSync
  • TouchTracker
  • TwoFingerSync
  • math
  • Matrix
  • Quaternion
  • Random
  • Utilities
  • Vector
  • modifiers
  • Draggable
  • Fader
  • ModifierChain
  • StateModifier
  • physics
  • PhysicsEngine
  • physics/bodies
  • Body
  • Circle
  • Particle
  • Rectangle
  • physics/constraints
  • Collision
  • Constraint
  • Curve
  • Distance
  • Snap
  • Surface
  • Wall
  • Walls
  • physics/forces
  • Drag
  • Force
  • Repulsion
  • RotationalDrag
  • RotationalSpring
  • Spring
  • VectorField
  • physics/integrators
  • SymplecticEuler
  • surfaces
  • CanvasSurface
  • ContainerSurface
  • ImageSurface
  • InputSurface
  • TextareaSurface
  • VideoSurface
  • transitions
  • CachedMap
  • Easing
  • MultipleTransition
  • SnapTransition
  • SpringTransition
  • Transitionable
  • TransitionableTransform
  • TweenTransition
  • WallTransition
  • utilities
  • KeyCodes
  • Timer
  • Utility
  • views
  • ContextualView
  • Deck
  • DrawerLayout
  • EdgeSwapper
  • FlexibleLayout
  • Flipper
  • GridLayout
  • HeaderFooterLayout
  • Lightbox
  • RenderController
  • ScrollContainer
  • Scroller
  • Scrollview
  • SequentialLayout
  • widgets
  • NavigationBar
  • TabBar

Spring

A force that moves a physics body to a location with a spring motion. The body can be moved to another physics body, or an anchor point.

Overview

Options
Methods
FENE
FENE
period
dampingRatio
length
length
anchor
forceFunction
setOptions
applyForce
getEnergy

Spring(options)

Constructor Parameters

options

Object

options to set on drag

Methods

Spring.FORCE_FUNCTIONS()ProtectedStatic

FENE(dist, rMax)

A FENE (Finitely Extensible Nonlinear Elastic) spring force see: http://en.wikipedia.org/wiki/FENE

Parameters
dist
Number
current distance target is from source body
rMax
Number
maximum range of influence
Returns
Number
unscaled force

FENE(dist)

A Hookean spring force, linear in the displacement see: http://en.wikipedia.org/wiki/Hooke's_law

Parameters
dist
Number
current distance target is from source body
Returns
Number
unscaled force

Spring.DEFAULT_OPTIONS()ProtectedStatic

period()

The amount of time in milliseconds taken for one complete oscillation when there is no damping Range : [150, Infinity]

dampingRatio()

The damping of the spring. Range : [0, 1] 0 = no damping, and the spring will oscillate forever 1 = critically damped (the spring will never oscillate)

length()

The rest length of the spring Range : [0, Infinity]

length()

The maximum length of the spring (for a FENE spring) Range : [0, Infinity]

anchor()

The location of the spring's anchor, if not another physics body

forceFunction()

The type of spring force

setOptions(options)

Basic options setter

Parameters
options
Object

applyForce(targets)

Adds a spring force to a physics body's force accumulator.

Parameters
targets
Array.Body
Array of bodies to apply force to.

getEnergy(targets)

Calculates the potential energy of the spring.

Parameters
targets
target The physics body attached to the spring
Returns
Source
The potential energy of the spring
Branding Terms Privacy Jobs © Famous Industries, Inc. 2015