- 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
Walls
Walls combines one or more Wall primitives and exposes a simple API to interact with several walls at once. A common use case would be to set up a bounding box for a physics body, that would collide with each side.
Overview
Options
sides] An array of sides e.g., [Walls.LEFT, Walls.TOP
size
origin
drift] Baumgarte stabilization parameter. Makes constraints "loosely" (0) or "tightly" (1) enforced. Range : [0, 1
slop
restitution
onContact
Methods
Walls.ON_CONTACT
Walls.SIDES
applyConstraint
applyConstraint
applyConstraint
applyConstraint
applyConstraint
Walls(options)
Constructor Parameters
options
Options
An object of configurable options.
sides] An array of sides e.g., [Walls.LEFT, Walls.TOP
Array
size
Array
The size of the bounding box of the walls.
origin
Array
The center of the wall relative to the size.
drift] Baumgarte stabilization parameter. Makes constraints "loosely" (0) or "tightly" (1) enforced. Range : [0, 1
Array
slop
Array
Amount of penetration in pixels to ignore before collision event triggers.
restitution
Array
The energy ratio lost in a collision (0 = stick, 1 = elastic) The energy ratio lost in a collision (0 = stick, 1 = elastic)
onContact
Array
How to handle collision against the wall.
Methods
Walls.ON_CONTACT()Static
Walls.SIDES()Static
An enumeration of common types of walls LEFT, RIGHT, TOP, BOTTOM, FRONT, BACK TWO_DIMENSIONAL, THREE_DIMENSIONAL
applyConstraint(targets, source, dt)
Adds an impulse to a physics body's velocity due to the walls constraint
Parameters
targets
Array.Body
Array of bodies to apply the constraint to
source
Body
The source of the constraint
dt
Number
Delta time
applyConstraint(fn)
Apply a method to each wall making up the walls
Parameters
fn
Function
Function that takes in a wall as its first parameter
applyConstraint(angle)
Rotates the walls by an angle in the XY-plane
Parameters
angle
Function
applyConstraint(angle)
Rotates the walls by an angle in the YZ-plane
Parameters
angle
Function
applyConstraint(angle)
Rotates the walls by an angle in the XZ-plane
Parameters
angle
Function