- core
- Context
- ElementAllocator
- ElementOutput
- Engine
- Entity
- EventEmitter
- EventHandler
- Group
- Modifier
- OptionsManager
- RenderNode
- Scene
- SpecParser
- 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
- Surface
- Collision
- Constraint
- Curve
- Distance
- Snap
- 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
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
Returns
FENE(dist)
A Hookean spring force, linear in the displacement see: http://en.wikipedia.org/wiki/Hooke's_law
Parameters
Returns
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
applyForce(targets)
Adds a spring force to a physics body's force accumulator.
Parameters
getEnergy(targets)
Calculates the potential energy of the spring.