Package | com.fileitup.fisixengine.resources |
Class | public class FractalTerrain |
Inheritance | FractalTerrain ![]() ![]() |
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 | |
![]() | 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 | |
![]() | 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 | |
surfacePoints : Array All the Vectors used to represent the terrain
| FractalTerrain | ||
![]() | 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 | ||
---|---|---|---|
FractalTerrain(start:Vector, end:Vector, height:Number, smooth:Number = 2, levels:int = 5, thickness:Number = 0, surfaceNormal:Vector = null, staticTerrain:Boolean = true)
Creates a FractalTerrain
It is important to note that the terrain will be created from left to right, so providing a start point to the right of the end point will create an upside-down terrain.
| FractalTerrain | ||
![]() |
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 | |
![]() |
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
| FisixObject | |
![]() |
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 | |
![]() |
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 | |
![]() |
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 | |
![]() |
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 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 | |
![]() |
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 | |
![]() |
setFriction(f:Number, recursive:Boolean = true):void
| FisixObject | |
![]() |
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 | |
![]() |
setTraction(t:Number, recursive:Boolean = true):void
| FisixObject | |
![]() |
setVelocity(vel:Vector, checkAA:Boolean = true):void
| FisixObject | |
![]() |
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 | |
![]() |
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 |
surfacePoints | property |
public var surfacePoints:Array
All the Vectors used to represent the terrain
FractalTerrain | () | constructor |
public function FractalTerrain(start:Vector, end:Vector, height:Number, smooth:Number = 2, levels:int = 5, thickness:Number = 0, surfaceNormal:Vector = null, staticTerrain:Boolean = true)
Creates a FractalTerrain It is important to note that the terrain will be created from left to right, so providing a start point to the right of the end point will create an upside-down terrain.
Parametersstart:Vector — The point in global space at which to start the terrain.
|
|
end:Vector — The point in global space at which to end the terrain.
|
|
height:Number — The maximum height of the terrain
|
|
smooth:Number (default = 2 ) — A value 1 or higher that represents the smoothness of the terrain. The higher this value, the less jagged the terrain will be.
|
|
levels:int (default = 5 ) — The higher this number, the more detailed the terrain will be. Setting this number too high may cause you application to crash because of the fractal terrain algorithm's recursive nature.
|
|
thickness:Number (default = 0 ) — The thickness of the surfaces created for the terrain.
|
|
surfaceNormal:Vector (default = null ) — Leave this null for automatic normal detection, or change it to affect the way the terrain is oriented.
For example, providing the argument - new Vector(0,1) will make sure that the terrain always points up.
|
|
staticTerrain:Boolean (default = true ) — Whether or not the terrain should be made static. If the terrain will never move, it is recommended that it be made static.
|