Packagecom.fileitup.fisixengine.primitives
Classpublic class Surface
InheritanceSurface Inheritance CollisionObject
SubclassesDynamicSurface, SurfaceConveyor

A static surface (doesn't move)

See also

com.fileitup.fisixengine.surfaces.DynamicSurface


Public Properties
 PropertyDefined by
 Inheritedactive : 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
 Inheritedbounce : Number = .5
The object's coefficient of reinstiturion.
CollisionObject
 Inheritedcollidable : 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
 Inheritedcolor : int = -1
The object's rendering color.
CollisionObject
 InheriteddynamicObjectCollisions : Boolean = false
CollisionObject
 Inheritedfixed : Boolean
A fixed CollisionObject is never influenced by collisions You may change this value at any time
CollisionObject
 Inheritedfriction : Number = 0
The object's coefficient of friction.
CollisionObject
 InheritedinheritAttributesOnAdd : Boolean = true
CollisionObject
 InheritedlastCollision : CollisionData
An internal object which stores the information of the object's last collision
CollisionObject
  length : Number
Surface
  line : Line
Surface
 Inheritedmagnetic : Boolean = true
If true, the object is affected by magnets
CollisionObject
 InheritedminX : Number
Hold the dimensions of the object's bounding box.
CollisionObject
 Inheritedname : String = ""
CollisionObject
 Inheritedparent : FisixObject
The parent of the object.
CollisionObject
  radius : Number
Surface
 Inheritedraycast : Boolean
An internal property, used by the engine
CollisionObject
 Inheritedtraction : Number = 1
The object's traction.
CollisionObject
 Inheritedtype : String
A string representing the type of object you are dealing with
CollisionObject
  vectorA : Vector
Surface
Protected Properties
 PropertyDefined by
 InheriteddetectionMode : int = 0
CollisionObject
 InheritedmFixed : Boolean = false
CollisionObject
 InheritedmMaterial : String
CollisionObject
 InheritedmStatic : Boolean = false
CollisionObject
 InheritedmyType : String = ""
CollisionObject
 InheritedreactionMode : int = 0
CollisionObject
 InheriteduseRaycasting : Boolean = false
CollisionObject
Public Methods
 MethodDefined by
  
Surface(pA:Vector, pB:Vector, r:Number = 0)
Creates a Surface object To conserve memory, all static surfaces should be composed of regular Vector objects.
If you would like the surface to move around (although it will only affect other objects and not be affected) you can supply a Particle's 'pos' property as the vector
Surface
 Inherited
Returns whether or not this object's AABB is intersecting with the given object's AABB
CollisionObject
 Inherited
applyForce(f:Vector, checkAA:Boolean = true):void
Applies a uniform force, moving the entire object.
CollisionObject
  
applyForceAt(f:Vector, t:Number):void
Not used on static surfaces
Surface
  
Applies a force at the given point.
Surface
  
dispose():void
Surface
 Inherited
CollisionObject
 Inherited
CollisionObject
 Inherited
fix(f:Boolean = true):void
Another way of setting the value 'fixed'.
CollisionObject
 Inherited
CollisionObject
  
getLength():Number
Returns the length of the surface
Surface
 Inherited
getMaterial():String
The name of the current material applied to the object
CollisionObject
 Inherited
CollisionObject
  
getNormalAt(p:Vector, dirVector:Vector = null):Vector
Surface
 Inherited
CollisionObject
  
Returns a vector between the first point of the surface to the second point.
Surface
 Inherited
isStatic():Boolean
Returns a value indicating whether or not this object was made static.
CollisionObject
 Inherited
makeStatic():void
Makes the object static.
CollisionObject
  
massOnSurface(t:Number):Number
This method is not used on static surfaces because their mass is always infinite.
Surface
 Inherited
onInit():void
Called after the object is initiated by a FisixObject to which it was added
CollisionObject
 Inherited
pointForce(point:Vector, force:Number):void
Applies a force value on the object from the given point.
CollisionObject
  
render(g:Graphics):void
Renders a primitive shape of the object to the given Graphics object.
Surface
 Inherited
renderBoundingBox(g:Graphics):void
Renders a rectangle representing the bounding box to the graphics object
CollisionObject
 Inherited
setDetectionMode(m:int):void
Sets the collision detection mode to be used by the object
CollisionObject
 Inherited
setMaterial(mName:String):void
Sets the material of the object This modifies the object's 'friction', 'bounce', 'color' and 'traction' properties.
CollisionObject
 Inherited
setReactionMode(m:int):void
Sets the collision reaction mode to be used by the object
CollisionObject
 Inherited
thrust(tX:Number, tY:Number, checkAA:Boolean = true):void
Moves the object uniformly with the given x,y values and adds the values to its velocity.
CollisionObject
  
thrustAt(tX:Number, tY:Number, t:Number):void
Not used on static surfaces
Surface
  
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.
Surface
 Inherited
unload():void
Removes the object from the engine and disposes of it.
CollisionObject
  
Updates the bounding box of the object.
Surface
Protected Methods
 MethodDefined by
 Inherited
Override this function to perform an action after a collision is resolved
CollisionObject
 Inherited
afterUnload():void
Override this method to perform actions after the object has been unloaded.
CollisionObject
 Inherited
Override this function to perform an action at the time a collision is detected
CollisionObject
 Inherited
onUnload():void
Override this method to perform actions once the object is unloaded.
CollisionObject
Property detail
lengthproperty
public var length:Number
lineproperty 
public var line:Line
radiusproperty 
public var radius:Number
vectorAproperty 
public var vectorA:Vector
Constructor detail
Surface()constructor
public function Surface(pA:Vector, pB:Vector, r:Number = 0)

Creates a Surface object To conserve memory, all static surfaces should be composed of regular Vector objects.
If you would like the surface to move around (although it will only affect other objects and not be affected) you can supply a Particle's 'pos' property as the vector

Parameters
pA:Vector — A vector Object to confine the first point of the surface to.
 
pB:Vector — A vector Object to confine the second point of the surface to.
 
r:Number (default = 0) — The radius of the surface

Example
You would do it like so:
   var s:Surface = myEngine.newSurface(particleA.pos,particleB.pos)
   

Method detail
applyForceAt()method
public function applyForceAt(f:Vector, t:Number):void

Not used on static surfaces

Parameters
f:Vector
 
t:Number

See also

applyForcePoint()method 
public override function applyForcePoint(f:Vector, p:Vector):void

Applies a force at the given point. Note that the point must be in global space

Parameters
f:Vector
 
p:Vector
dispose()method 
public override function dispose():void

getLength()method 
public function getLength():Number

Returns the length of the surface

Returns
Number
getNormalAt()method 
public override function getNormalAt(p:Vector, dirVector:Vector = null):Vector

Parameters
p:Vector
 
dirVector:Vector (default = null)

Returns
Vector
getVector()method 
public function getVector():Vector

Returns a vector between the first point of the surface to the second point.

Returns
Vector
massOnSurface()method 
public function massOnSurface(t:Number):Number

This method is not used on static surfaces because their mass is always infinite.

Parameters
t:Number

Returns
Number

See also

render()method 
public override function render(g:Graphics):void

Renders a primitive shape of the object to the given Graphics object. Usually this method is automatically invoked by the engine, but you may use it to render individual objects.

Parameters
g:Graphics
thrustAt()method 
public function thrustAt(tX:Number, tY:Number, t:Number):void

Not used on static surfaces

Parameters
tX:Number
 
tY:Number
 
t:Number

See also

thrustPoint()method 
public override function 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. This is more realistically accurate than thrust(). Refrain from using this method to avoid penetration. Instead, use applyForcePoint()

Parameters
tX:Number
 
tY:Number
 
p:Vector
updateBoundingBox()method 
public override function updateBoundingBox():void

Updates the bounding box of the object. This is an internal methods that is called many times a frame. Calling it manually won't do much.