Package | com.fileitup.fisixengine.core |
Class | public final class FisixEngine |
Inheritance | FisixEngine ![]() ![]() |
See also
Property | Defined by | ||
---|---|---|---|
![]() | active : Boolean = true Tells the engine whether or not to treat this object as a part of the simulation
This value may be changed at any time during the simulation | CollisionObject | |
![]() | axisAligned : Boolean = false When set to true, the FisixObject will be Rigid and Axis-Aligned.
When the FisixObject is 'axisAligned', all the Particles within will always maintain the same distance to eachother. Additionally, the entire object will not rotate. | FisixObject | |
![]() | bounce : Number = .5 The object's coefficient of reinstiturion.
| CollisionObject | |
![]() | boundsCollisions : Boolean = false When true, all children of the FisixObject will be confined to the boundaries set by setBounds()
| FisixObject | |
![]() | collidable : Boolean = true Tells the engine whether or not to check collisions against this object
You may set this value at any time during the sumulation to turn collision detection on/off for this object
| CollisionObject | |
![]() | color : int = -1 The object's rendering color.
| CollisionObject | |
![]() | constraints : Array an array containing all of the Constraints in the FisixObject.
| FisixObject | |
![]() | constraints : Array | FisixObject | |
![]() | containers : Array an array containing all of the Containers in the FisixObject.
| FisixObject | |
![]() | containers : Array | FisixObject | |
![]() | displayAttachers : Array | FisixObject | |
![]() | drag : Number = 0 A value between 0 - 1 representing the amount of drag to apply on all children of the object.
| FisixObject | |
![]() | dynamicObjectCollisions : Boolean = false | CollisionObject | |
![]() | fisixObjects : Array an array containing all of the FisixObjects in the FisixObject.
| FisixObject | |
![]() | fisixObjects : Array | FisixObject | |
![]() | fixed : Boolean A fixed CollisionObject is never influenced by collisions
You may change this value at any time
| CollisionObject | |
![]() | friction : Number = 0 The object's coefficient of friction.
| CollisionObject | |
graphics : Graphics [static]
| FisixEngine | ||
gravity : Vector | FisixEngine | ||
![]() | guides : Array an array containing all of the GuideParticles in the FisixObject.
| FisixObject | |
![]() | guides : Array | FisixObject | |
![]() | inheritAttributesOnAdd : Boolean = true | CollisionObject | |
![]() | innerCollisions : Boolean = true When true, objects within the FisixObject will collide with among themselves.
| FisixObject | |
![]() | lastCollision : CollisionData
An internal object which stores the information of the object's last collision
| CollisionObject | |
![]() | magnetic : Boolean = true If true, the object is affected by magnets
| CollisionObject | |
![]() | magnets : Array an array containing all of the Magnets in the FisixObject.
| FisixObject | |
![]() | magnets : Array | FisixObject | |
![]() | minX : Number Hold the dimensions of the object's bounding box.
| CollisionObject | |
mouseAttachers : Array | FisixEngine | ||
![]() | name : String = "" | CollisionObject | |
![]() | parent : FisixObject
The parent of the object.
| CollisionObject | |
![]() | particles : Array an array containing all of the Particles in the FisixObject.
| FisixObject | |
![]() | particles : Array | FisixObject | |
![]() | polygons : Array an array containing all of the Polygons in the FisixObject.
| FisixObject | |
![]() | raycast : Boolean An internal property, used by the engine
| CollisionObject | |
![]() | renderBoundingBoxes : Boolean = false When true, calling render() will also render the bounding boxes of all children objects
| FisixObject | |
![]() | surfaces : Array an array containing all of the Surfaces in the FisixObject.
| FisixObject | |
![]() | surfaces : Array | FisixObject | |
![]() | thrusts : Array an array containing all of the Thrusts in the FisixObject.
| FisixObject | |
![]() | thrusts : Array | FisixObject | |
![]() | traction : Number = 1 The object's traction.
| CollisionObject | |
![]() | type : String A string representing the type of object you are dealing with
| CollisionObject |
Method | Defined by | ||
---|---|---|---|
FisixEngine | |||
![]() |
aabbIntersection(obj:CollisionObject):Boolean
Returns whether or not this object's AABB is intersecting with the given object's AABB
| CollisionObject | |
![]() |
Adds a constraint to the engine from an object previously instanciated.
| FisixObject | |
![]() |
Adds a container to the FisixObject.
| FisixObject | |
![]() |
Use to add a DisplayAttacher object to the simulation
| FisixObject | |
![]() |
Adds a Magnet Object to the simulation.
| FisixObject | |
Use to add a MouseAttacher object to the simulation
| FisixEngine | ||
![]() |
Used to add an object instantiated by the user to the object.
| FisixObject | |
![]() |
Adds a thrust to the engine.
| FisixObject | |
![]() |
applyForce(f:Vector, checkAA:Boolean = true):void
Applies a force to all of the dynamic objects within the FisixObject
| FisixObject | |
![]() |
Applies a force at the given point.
| CollisionObject | |
![]() |
constraintAllParticles(stiffness:Number = 1, breakPoint:Number = 0):void
Constraints all of the particles of the object to eachother.
| FisixObject | |
dispose():void
| FisixEngine | ||
![]() |
Create an explosion in the given position which will affect all the objects within the FisixObject.
| FisixObject | |
![]() |
fireAfterChildCollision(child:CollisionObject):void
| FisixObject | |
![]() |
fireAfterCollision():void
| CollisionObject | |
![]() |
fireOnChildCollision(child:CollisionObject):void
| FisixObject | |
![]() |
fireOnCollision():void
| CollisionObject | |
![]() |
fix(f:Boolean = true):void
Another way of setting the value 'fixed'.
| CollisionObject | |
![]() |
flipJoints():void
Flips all the angular constraints in the FisixObject
| FisixObject | |
![]() |
| FisixObject | |
![]() |
Returns the center point of all the objects in the FisixObject
Editing this vector will have no affects on the object.
| FisixObject | |
![]() |
getDetectionMode():int
| CollisionObject | |
![]() |
getIterations():int
| FisixObject | |
![]() |
getMaterial():String
The name of the current material applied to the object
| CollisionObject | |
![]() |
getNormalAngleAt(p:Vector):Number
| CollisionObject | |
![]() | CollisionObject | ||
![]() |
getReactionMode():int
| CollisionObject | |
getRealFPS():Number
Returns the current framerate of your simulation.
| FisixEngine | ||
![]() |
integrate(dt:Number = 1):void
Integrates all children forward in time.
| FisixObject | |
![]() |
isStatic():Boolean
Returns a value indicating whether or not this object was made static.
| CollisionObject | |
mainLoop(dt:Number = 1):void
This method should be called in your ENTER_FRAME event if you decide not to use startEngine().
| FisixEngine | ||
![]() |
makeStatic():void
Tells the engine to treat all objects within this FisixObject as static.
| FisixObject | |
![]() |
move(tX:Number, tY:Number, recursive:Boolean = true):void
simply translates all children of the object by the given x and y offsets
| FisixObject | |
![]() |
newAngularConstraint(pA:Particle, pB:Particle, pC:Particle, min:Number = -1, max:Number = -1):AngularConstraint
| FisixObject | |
![]() |
newCircleContainer(x:Number, y:Number, rad:Number, innerDynamics:Boolean = true):CircleContainer
Creates and adds a CircleConstraint in one line.
| FisixObject | |
![]() |
newCircleParticle(x:Number, y:Number, r:Number):CircleParticle
Creates and adds a CircleParticle in one line.
| FisixObject | |
![]() |
newConstraintAttacher(mc:DisplayObject, springConstraint:SpringConstraint, angOff:Number = 0, mult:Number = 1):ConstraintAttacher
Creates and adds a ConstraintAttacher to the engine.
| FisixObject | |
![]() |
newDisplayAttacher(mc:DisplayObject, v1:Vector, xOffset:Number = 0, yOffset:Number = 0):DisplayAttacher2
Creates and adds a DisplayAttacher to the engine.
| FisixObject | |
![]() |
newDisplayAttacher2(mc:DisplayObject, v1:Vector, v2:Vector, angOff:Number = 0, mult:Number = 1):DisplayAttacher2
Creates and adds a DisplayAttacher2 to the engine.
| FisixObject | |
![]() |
newDisplayAttacher3(mc:DisplayObject, v1:Vector, v2:Vector, v3:Vector, angOff:Number = 0, mult:Number = 1):DisplayAttacher3
Creates and adds a DisplayAttacher3 to the engine.
| FisixObject | |
![]() |
Creates and adds a DynamicSurface in one line.
| FisixObject | |
![]() |
Creates and adds a FisixObject in one line
| FisixObject | |
![]() |
newGuideParticle(x:Number, y:Number):GuideParticle
Creates and adds a GuideParticle in one line.
| FisixObject | |
![]() |
Creates and adds a Magnet in one line.
| FisixObject | |
Creates and adds a MouseAttacher to the engine.
| FisixEngine | ||
![]() |
newParticleAttacher(mc:DisplayObject, particle:Particle, xOffset:Number = 0, yOffset:Number = 0):ParticleAttacher
Creates and adds a ParticleAttacher to the engine.
| FisixObject | |
![]() |
newSpringConstraint(pA:Particle, pB:Particle, stiffness:Number = 0.5, restlength:Number = -1):SpringConstraint
Creates and adds a SpringConstraint in one line.
| FisixObject | |
![]() |
Creates and adds a StickConstraint in one line.
| FisixObject | |
![]() |
Creates and adds a static Surface in one line.
| FisixObject | |
![]() |
newSurfaceAttacher(mc:DisplayObject, surface:Surface, angOff:Number = 0, mult:Number = 1):SurfaceAttacher
Creates and adds a SurfaceAttacher to the engine.
| FisixObject | |
![]() |
Creates and adds a Thrust in one line.
| FisixObject | |
![]() |
newWheelAttacher(mc:DisplayObject, wheel:WheelParticle, angOff:Number = 0, mult:Number = 1):WheelAttacher
Creates and adds a WheelAttacher to the engine.
| FisixObject | |
![]() |
newWheelContainer(x:Number, y:Number, rad:Number, innerDynamics:Boolean = true):WheelContainer
| FisixObject | |
![]() |
newWheelParticle(x:Number, y:Number, r:Number):WheelParticle
Creates and adds a WheelParticle in one line.
| FisixObject | |
![]() |
onInit():void
Called after the object is initiated by a FisixObject to which it was added
| CollisionObject | |
![]() |
pickParticle(x:Number, y:Number, radius:Number = 0):CircleParticle
Finds a particle located at the given position
| FisixObject | |
![]() |
pointForce(point:Vector, force:Number):void
Applies a force value on the object from the given point.
| FisixObject | |
![]() |
Removes a constraint previously added to the FisixObject.
| FisixObject | |
![]() |
Removes a Container previously added.
| FisixObject | |
![]() |
Use to remove a DisplayAttacher object that was added to the simulation
| FisixObject | |
![]() |
Removes a Magnet that was previously added.
| FisixObject | |
Removes a MouseAttacher object that was added to the simulation.
| FisixEngine | ||
![]() |
Removes any object added using addObject().
| FisixObject | |
![]() |
Removes a thrust added with addThrust().
| FisixObject | |
![]() |
render(g:Graphics):void
renders all children to the given Graphics object.
| FisixObject | |
renderAll(g:Graphics = null):void
Renders all of the objects in the current simulation.
| FisixEngine | ||
![]() |
renderBoundingBox(g:Graphics):void
Renders a rectangle representing the bounding box to the graphics object
| CollisionObject | |
![]() |
renderConstraints(g:Graphics):void
Renders all the constraints within the FisixObject.
| FisixObject | |
![]() |
renderFisixObjects(g:Graphics):void
Renders all the FisixObjects within the FisixObject.
| FisixObject | |
![]() |
renderGuides(g:Graphics):void
Renders all the guide particles within the FisixObject.
| FisixObject | |
![]() |
renderMagnets(g:Graphics):void
Renders all the magnets within the FisixObject.
| FisixObject | |
![]() |
renderParticles(g:Graphics):void
Renders all the particles within the FisixObject.
| FisixObject | |
![]() |
renderPolygons(g:Graphics):void
Renders all the polygons within the FisixObject.
| FisixObject | |
![]() |
renderSurfaces(g:Graphics):void
Renders all the surfaces within the FisixObject.
| FisixObject | |
![]() |
Rotates all children of the object by the given angle.
| FisixObject | |
![]() |
rotationalForce(deg:Number, center:Vector = null):void
| FisixObject | |
![]() |
rotationalThrust(deg:Number, center:Vector = null):void
| FisixObject | |
![]() |
scale(scaleX:Number, scaleY:Number, flipAngularConstraints:Boolean = false, pivot:Vector = null):void
Scales all the objects withing the FisixObject.
| FisixObject | |
![]() |
setAllDetectionModes(m:int, recursive:Boolean = true):void
overrides the collision detection mode of all objects within the FisixObject and sets them to the given value.
| FisixObject | |
![]() |
setAllReactionModes(m:int, recursive:Boolean = true):void
overrides the collision reaction mode of all objects within the FisixObject and sets them to the given value
This does not affect the settings of objects added after this call
| FisixObject | |
![]() |
setBounce(b:Number, recursive:Boolean = true):void
| FisixObject | |
![]() |
setBounds(b:BoundingBox):void
Sets the bounding rectangle of all the objects within the FisixObject.
| FisixObject | |
![]() |
setCenter(cX:Number, cY:Number, thrustObject:Boolean = false):void
Moves all children of the object so that their center corresponds with the given values.
| FisixObject | |
![]() |
setDetectionMode(m:int):void
Sets the collision detection mode to be used by the object
| CollisionObject | |
![]() |
setDrag(d:Number, recursive:Boolean = true):void
| FisixObject | |
![]() |
setFixed(f:Boolean, recursive:Boolean = true):void
| FisixObject | |
setFPS(fps:int):void
Sets the target framerate from the simulation
| FisixEngine | ||
![]() |
setFriction(f:Number, recursive:Boolean = true):void
| FisixObject | |
setGravity(gX:Number, gY:Number):void
Sets the global gravity for the entire simulation.
| FisixEngine | ||
![]() |
setIterations(iter:int):void
Sets the amount of times per frame that the collisions and constraints within this object's children should be solved.
| FisixObject | |
![]() |
setMagnetic(m:Boolean, recursive:Boolean = true):void
| FisixObject | |
![]() |
setMaterial(mName:String):void
Sets the material of the object
This modifies the object's 'friction', 'bounce', 'color' and 'traction' properties.
| CollisionObject | |
![]() |
setReactionMode(m:int):void
Sets the collision reaction mode to be used by the object
| CollisionObject | |
setRender(r:Boolean):void
Tells the engine to render to the 'renderGraphics' Graphics object at every frame.
| FisixEngine | ||
setRenderGraphics(g:Graphics):void
Sets the graphics object to which all primitives will be rendered.
| FisixEngine | ||
![]() |
setTraction(t:Number, recursive:Boolean = true):void
| FisixObject | |
![]() |
setVelocity(vel:Vector, checkAA:Boolean = true):void
| FisixObject | |
startEngine(fps:int = 30):void
Starts the engine without the need to use onEnterFrame.
| FisixEngine | ||
stopEngine():void
Used in conjuntion with startEngine to pause the engie.
| FisixEngine | ||
![]() |
thrust(tX:Number, tY:Number, checkAA:Boolean = true):void
Thrusts all collision objects in the object with the given force
| FisixObject | |
![]() |
thrustPoint(tX:Number, tY:Number, p:Vector):void
Unlike thrust which moves the whole object, thrustPoint() hits the object from the given point, with the given x,y values and adds the values to its velocity.
| CollisionObject | |
timestep(dt:Number):void
Updates the simulation by the given time amount.
| FisixEngine | ||
![]() |
unload():void
Removes the object from the engine and disposes of it.
| CollisionObject | |
![]() |
updateBoundingBox():void
Updates the bounding box of the object.
| CollisionObject | |
![]() |
updateDisplays():void
updates all the DisplayAttachers in the engine.
| FisixObject | |
updateMice():void
updates all the MouseAttachers in the engine.
| FisixEngine |
graphics | property |
public static var graphics:Graphics
gravity | property |
public var gravity:Vector
mouseAttachers | property |
public var mouseAttachers:Array
FisixEngine | () | constructor |
public function FisixEngine()
addMouseAttacher | () | method |
public function addMouseAttacher(m:MouseAttacher):MouseAttacher
Use to add a MouseAttacher object to the simulation
Parametersm:MouseAttacher — An instance of the MouseAttacher class, or any of its descendents.
return The added object is successful. null if there was an error
|
MouseAttacher |
dispose | () | method |
public override function dispose():void
getRealFPS | () | method |
public function getRealFPS():Number
Returns the current framerate of your simulation. This may differ from the fps value you set because the cpu cannot perform.
ReturnsNumber |
See also
mainLoop | () | method |
public function mainLoop(dt:Number = 1):void
This method should be called in your ENTER_FRAME event if you decide not to use startEngine(). This method is self-sufficient, and is the only one that you need to call on every frame.
Parametersdt:Number (default = 1 )
|
newMouseAttacher | () | method |
public function newMouseAttacher(obj:Particle, mouse:DisplayObject, ease:Number = 1):MouseAttacher
Creates and adds a MouseAttacher to the engine.
Parametersobj:Particle — A Particle to attach to the mouse. (ie a Particle, Wheel, Polygon...)
|
|
mouse:DisplayObject — A Flash DisplayObject which serves as the parent of the mouse (ie. root)
|
|
ease:Number (default = 1 ) — A value higher or equal to one which represents the amount of easing to be applied.
One represents no easing.
|
MouseAttacher —
The created MouseAttacher. null if creation was unsuccessful
|
See also
removeMouseAttacher | () | method |
public function removeMouseAttacher(m:MouseAttacher):MouseAttacher
Removes a MouseAttacher object that was added to the simulation.
Parametersm:MouseAttacher |
MouseAttacher |
renderAll | () | method |
public function renderAll(g:Graphics = null):void
Renders all of the objects in the current simulation.
Parametersg:Graphics (default = null ) — A graphics object to render to. if none is supplied, the one set by setRenderGraphics() will be used.
|
See also
setFPS | () | method |
public function setFPS(fps:int):void
Sets the target framerate from the simulation
Parametersfps:int |
setGravity | () | method |
public function setGravity(gX:Number, gY:Number):void
Sets the global gravity for the entire simulation.
This method simply adds a thrust to all the objects within the world
gX:Number |
|
gY:Number |
See also
setRender | () | method |
public function setRender(r:Boolean):void
Tells the engine to render to the 'renderGraphics' Graphics object at every frame. This is only used in the 'mainLoop' method.
Parametersr:Boolean |
setRenderGraphics | () | method |
public function setRenderGraphics(g:Graphics):void
Sets the graphics object to which all primitives will be rendered. Only used if setRender(true) is called
Parametersg:Graphics |
See also
startEngine | () | method |
public function startEngine(fps:int = 30):void
Starts the engine without the need to use onEnterFrame.
Parametersfps:int (default = 30 ) — the target fps value for the engine.
|
See also
stopEngine | () | method |
public function stopEngine():void
Used in conjuntion with startEngine to pause the engie.
See also
timestep | () | method |
public function timestep(dt:Number):void
Updates the simulation by the given time amount. This method is invoked automatically and shouldn't be used manually.
Parametersdt:Number |
updateMice | () | method |
public function updateMice():void
updates all the MouseAttachers in the engine. This method is invoked automatically by the engine.