- 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
Drag
Drag is a force that opposes velocity. Attach it to the physics engine to slow down a physics body in motion.
Overview
Options
Methods
LINEAR
QUADRATIC
strength
forceFunction
applyForce
setOptions
Drag(options)
Constructor Parameters
options
Object
options to set on drag
Methods
Drag.FORCE_FUNCTIONS()ProtectedStatic
LINEAR(velocity)
A drag force proportional to the velocity
Parameters
velocity
Vector
Returns
Vector
drag force
QUADRATIC(velocity)
A drag force proportional to the square of the velocity
Parameters
velocity
Vector
Returns
Vector
drag force
Drag.DEFAULT_OPTIONS()ProtectedStatic
strength()
The strength of the force Range : [0, 0.1]
forceFunction()
The type of opposing force
applyForce(targets)
Adds a drag force to a physics body's force accumulator.
Parameters
targets
Array.Body
Array of bodies to apply drag force to.
setOptions(options)
Basic options setter
Parameters
options
Objects