φ Famo.us University Famo.us/Angular Docs Help Blog Download
  • 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

Repulsion

Repulsion is a force that repels (attracts) bodies away (towards) each other. A repulsion of negative strength is attractive.

Overview

Options
Methods
LINEAR
MORSE
INVERSE
GRAVITY
strength
anchor
radii
cutoff
cap
decayFunction
applyForce

Repulsion(options)

Constructor Parameters

options

Object

overwrites default options

Methods

Repulsion.DECAY_FUNCTIONS()ProtectedStatic

LINEAR(r, cutoff)

A linear decay function

Parameters
r
Number
distance from the source body
cutoff
Number
the effective radius of influence

MORSE(r, cutoff)

A Morse potential decay function (http://en.wikipedia.org/wiki/Morse_potential)

Parameters
r
Number
distance from the source body
cutoff
Number
the minimum radius of influence

INVERSE(r, cutoff)

An inverse distance decay function

Parameters
r
Number
distance from the source body
cutoff
Number
a distance shift to avoid singularities

GRAVITY(r, cutoff)

An inverse squared distance decay function

Parameters
r
Number
distance from the source body
cutoff
Number
a distance shift to avoid singularities

Repulsion.DEFAULT_OPTIONS()ProtectedStatic

strength()

The strength of the force Range : [0, 100]

anchor()

The location of the force, if not another physics body

radii()

The range of the repulsive force

cutoff()

A normalization for the force to avoid singularities at the origin

cap()

The maximum magnitude of the force Range : [0, Infinity]

decayFunction()

The type of decay the repulsive force should have

applyForce(targets, source)

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

Parameters
targets
Array.Body
Array of bodies to apply force to.
source
Body
The source of the force
Branding Terms Privacy Jobs © Famous Industries, Inc. 2015