Packagecom.fileitup.fisixengine.surfaces
Classpublic class DynamicSurface
InheritanceDynamicSurface Inheritance Surface Inheritance CollisionObject

Similar to the Surface object, only this one can move. Unlike a Surface, a DynamicSurface reacts to collisions with other objects.



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
 Inheritedlength : Number
Surface
 Inheritedline : 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
  particleA : Particle
DynamicSurface
  particleB : Particle
DynamicSurface
 Inheritedradius : 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
 InheritedvectorA : 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
  
DynamicSurface(pA:Particle, pB:Particle, rad:Number = 0)
Creates a DynamicSurface object
DynamicSurface
 Inherited
Returns whether or not this object's AABB is intersecting with the given object's AABB
CollisionObject
  
applyForce(f:Vector, checkAA:Boolean = true):void
Applies a force to both end points of the surface.
DynamicSurface
  
applyForceAt(f:Vector, t:Number):void
Similar to thrustAt(), but adds to the object's acceleration instead of its position.
DynamicSurface
  
Similar to thrustPoint(), but adds to the object's acceleration instead of its position.
DynamicSurface
  
dispose():void
DynamicSurface
 Inherited
CollisionObject
 Inherited
CollisionObject
 Inherited
fix(f:Boolean = true):void
Another way of setting the value 'fixed'.
CollisionObject
 Inherited
CollisionObject
 Inherited
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
 Inherited
getNormalAt(p:Vector, dirVector:Vector = null):Vector
Surface
 Inherited
CollisionObject
 Inherited
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
  
makeStatic():void
Makes the object static.
DynamicSurface
  
massOnSurface(t:Number):Number
Returns the intepolated mass on the surface from the mass of its two points.
DynamicSurface
 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
 Inherited
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
  
thrust(tX:Number, tY:Number, checkAA:Boolean = true):void
Applies a thrust to both end points of the surface.
DynamicSurface
  
thrustAt(tX:Number, tY:Number, t:Number):void
Thrusts the Surface at the given 't' value with the given x/y thrusts
DynamicSurface
  
thrustPoint(tX:Number, tY:Number, p:Vector):void
Thrusts the Surface at the given point with the given x/y thrusts
DynamicSurface
 Inherited
unload():void
Removes the object from the engine and disposes of it.
CollisionObject
 Inherited
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
particleAproperty
public var particleA:Particle
particleBproperty 
public var particleB:Particle
Constructor detail
DynamicSurface()constructor
public function DynamicSurface(pA:Particle, pB:Particle, rad:Number = 0)

Creates a DynamicSurface object

Parameters
pA:Particle — A vector Object to confine the first point of the surface to.
 
pB:Particle — A vector Object to confine the second point of the surface to.
 
rad:Number (default = 0) — The radius of the surface
Method detail
applyForce()method
public override function applyForce(f:Vector, checkAA:Boolean = true):void

Applies a force to both end points of the surface.

Parameters
f:Vector
 
checkAA:Boolean (default = true)
applyForceAt()method 
public override function applyForceAt(f:Vector, t:Number):void

Similar to thrustAt(), but adds to the object's acceleration instead of its position. Use this method to avoid penetrations with other objects.

Parameters
f:Vector
 
t:Number

See also

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

Similar to thrustPoint(), but adds to the object's acceleration instead of its position. Use this method to avoid penetrations with other objects.

Parameters
f:Vector
 
p:Vector

See also

dispose()method 
public override function dispose():void

makeStatic()method 
public override function makeStatic():void

Makes the object static. Once this function is called, an object cannot be made dynamic again. By calling this you are telling the engine that this object will never move. This helps to optimize collision detection with things like terrains and unmovable obstacles

massOnSurface()method 
public override function massOnSurface(t:Number):Number

Returns the intepolated mass on the surface from the mass of its two points.

Parameters
t:Number — A value between 0 - 1 representing a point on te surface.

Returns
Number
thrust()method 
public override function thrust(tX:Number, tY:Number, checkAA:Boolean = true):void

Applies a thrust to both end points of the surface.

Parameters
tX:Number
 
tY:Number
 
checkAA:Boolean (default = true)
thrustAt()method 
public override function thrustAt(tX:Number, tY:Number, t:Number):void

Thrusts the Surface at the given 't' value with the given x/y thrusts

Parameters
tX:Number — The x component of the thrust
 
tY:Number — the y component of the thrust
 
t:Number — A value between 0-1 representing a point on the surface. If you prefer, you can use thrustPoint() to define a point in global space.

See also

thrustPoint()method 
public override function thrustPoint(tX:Number, tY:Number, p:Vector):void

Thrusts the Surface at the given point with the given x/y thrusts

Parameters
tX:Number — The x component of the thrust
 
tY:Number — the y component of the thrust
 
p:Vector — A vector representing a point in global space. This point should be on the surface, but if it's not it will be cliped to it.

See also