| Property | Defined by | ||
|---|---|---|---|
| solverIterations : int [write-only]
Sets the number of times the timestep is subdivided and collision is checked
| PhysicsEngine | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new Physics Engine
This should be viewed as a work in progress. | PhysicsEngine | ||
|
addCollidable(collidable:ISimulatable):void
Adds a collidable element to the engine.
| PhysicsEngine | ||
|
addODESolver(solver:IODESolver):void
Adds an IODESolver to the engine.
| PhysicsEngine | ||
|
Gets an IBody that collides with the given point, if any
| PhysicsEngine | ||
|
removeCollidable(collidable:ISimulatable):void
Removes a collidable element from simulation
| PhysicsEngine | ||
|
removeODESolver(solver:IODESolver):void
Removes an IODESolver from the simulation
| PhysicsEngine | ||
|
setCoarseCollisionDetector(detector:ICoarseCollisionDetector):void
Sets the engine's coarse collision detector
| PhysicsEngine | ||
|
setCollisionFactory(factory:ICollisionFactory):void
Defines the collision factory used by the coarse detector to return IFineCollisionDetectors
| PhysicsEngine | ||
|
step(dt:Number = 1.0):void
This seemingly harmless little method is the heart of the physics simulation.
| PhysicsEngine | ||
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT_COARSE_COLLISION_DETECTOR : Class [static] offers a default ICoarseCollisionDetector class
| PhysicsEngine | ||
| SOLVER_ITERATIONS : int = 3 [static] offers a default number of iterations per frame
| PhysicsEngine | ||
| solverIterations | property |
solverIterations:int [write-only]Sets the number of times the timestep is subdivided and collision is checked
Implementation public function set solverIterations(value:int):void
See also
| PhysicsEngine | () | constructor |
public function PhysicsEngine()Creates a new Physics Engine
This should be viewed as a work in progress. It currently uses a less-than-desirable approach to contact resolution. All functionality is pretty well broken out and shouldn't affect the user even given radical changes in future releases
Instantiation is typically handled through the Foam interface.
See also
| addCollidable | () | method |
public function addCollidable(collidable:ISimulatable):voidAdds a collidable element to the engine. Because the engine draws a distinction between solvers and collidable elements, collidable elements can be added without needing its state solved and vice versa.
Parameterscollidable:ISimulatable — ISimulatable to add to collision list
|
See also
| addODESolver | () | method |
public function addODESolver(solver:IODESolver):voidAdds an IODESolver to the engine. Because the engine draws a distinction between solvers and collidable elements, IODESolvers can be added without being tested/solved for collision and vice versa.
Parameterssolver:IODESolver — IODESolver to add
|
See also
| getBodyUnderPoint | () | method |
public function getBodyUnderPoint(point:Vector):IBodyGets an IBody that collides with the given point, if any
Parameterspoint:Vector — Vector to check against all bodies
|
IBody |
See also
| removeCollidable | () | method |
public function removeCollidable(collidable:ISimulatable):voidRemoves a collidable element from simulation
Parameterscollidable:ISimulatable — element to remove
|
| removeODESolver | () | method |
public function removeODESolver(solver:IODESolver):voidRemoves an IODESolver from the simulation
Parameterssolver:IODESolver — IODESolver to remove
|
| setCoarseCollisionDetector | () | method |
public function setCoarseCollisionDetector(detector:ICoarseCollisionDetector):voidSets the engine's coarse collision detector
Parametersdetector:ICoarseCollisionDetector — ICoarseCollisionDetector to handle broad phase culling
|
| setCollisionFactory | () | method |
public function setCollisionFactory(factory:ICollisionFactory):voidDefines the collision factory used by the coarse detector to return IFineCollisionDetectors
Parametersfactory:ICollisionFactory — CollisionFactory
|
| step | () | method |
public function step(dt:Number = 1.0):voidThis seemingly harmless little method is the heart of the physics simulation.
It takes a stepsize over which to advance the state of the system.
The more discrete the time step (and resultant subdivided timesteps
based on _solverIterations) the more realistic the
simulation. Realism comes at the cost of performance.
dt:Number (default = 1.0) — timestep with which to advance the system
|
See also
| DEFAULT_COARSE_COLLISION_DETECTOR | constant |
public static const DEFAULT_COARSE_COLLISION_DETECTOR:Classoffers a default ICoarseCollisionDetector class
| SOLVER_ITERATIONS | constant |
public static const SOLVER_ITERATIONS:int = 3offers a default number of iterations per frame