- 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
Body
A unit controlled by the physics engine which extends the zero-dimensional Particle to include geometry. In addition to maintaining the state of a Particle its state includes orientation, angular velocity and angular momentum and responds to torque forces.
Overview
Methods
Methods
setMomentsOfInertia()
Setter for moment of inertia, which is necessary to give proper angular inertia depending on the geometry of the body.
updateAngularVelocity()
Update the angular velocity from the angular momentum state.
toWorldCoordinates(localPosition)
Determine world coordinates from the local coordinate system. Useful if the Body has rotated in space.
Parameters
Returns
getEnergy()
Calculates the kinetic and intertial energy of a body.
Returns
reset(p, v, q, L)
Extends Particle.reset to reset orientation, angular velocity and angular momentum.
Parameters
setOrientation(q)
Setter for orientation
Parameters
setAngularVelocity(w)
Setter for angular velocity
Parameters
setAngularMomentum(L)
Setter for angular momentum
Parameters
applyForce(force, location)
Extends Particle.applyForce with an optional argument to apply the force at an off-centered location, resulting in a torque.
Parameters
applyTorque(torque)
Applied a torque force to a body, inducing a rotation.
Parameters
getTransform()
Extends Particle.getTransform to include a rotational component derived from the particle's orientation.
Returns
getTransform(dt)Protected
Extends Particle._integrate to also update the rotational states of the body.
Parameters
integrateAngularMomentum(dt)
Updates the angular momentum via the its integrator.
Parameters
integrateOrientation(dt)
Updates the orientation via the its integrator.