- 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
Distance
A constraint that keeps a physics body a given distance away from a given anchor, or another attached body.
Overview
Options
anchor
length
minLength
period
dampingRatio
Methods
setOptions
applyConstraint
Distance(options)
Constructor Parameters
options
Options
An object of configurable options.
anchor
Array
The location of the anchor
length
Number
The amount of distance from the anchor the constraint should enforce
minLength
Number
The minimum distance before the constraint is activated. Use this property for a "rope" effect.
period
Number
The spring-like reaction when the constraint is broken.
dampingRatio
Number
The damping-like reaction when the constraint is broken.
Methods
setOptions(anchor)
Set the anchor position
Parameters
anchor
Array
applyConstraint(targets, source, dt)
Adds an impulse to a physics body's velocity due to the constraint
Parameters
targets
Array.Body
Array of bodies to apply the constraint to
source
Body
The source of the constraint
dt
Number
Delta time