Packagecom.fileitup.fisixengine.core
Classpublic class CollisionObject
ImplementsEngineObject
SubclassesFisixObject, Particle, Surface

The parent of all objects with physical presence. This class does not represent a specific object, and cannot be added to the simulation.
Instead, use particles, surfaces, and polygons

See also

FisixObject.addObject()


Public Properties
 PropertyDefined 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
  bounce : Number = .5
The object's coefficient of reinstiturion.
CollisionObject
  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
  dynamicObjectCollisions : Boolean = false
CollisionObject
  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
  inheritAttributesOnAdd : Boolean = true
CollisionObject
  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
  minX : Number
Hold the dimensions of the object's bounding box.
CollisionObject
  name : String = ""
CollisionObject
  parent : FisixObject
The parent of the object.
CollisionObject
  raycast : Boolean
[read-only]An internal property, used by the engine
CollisionObject
  traction : Number = 1
The object's traction.
CollisionObject
  type : String
[read-only]A string representing the type of object you are dealing with
CollisionObject
Protected Properties
 PropertyDefined by
  detectionMode : int = 0
CollisionObject
  mFixed : Boolean = false
CollisionObject
  mMaterial : String
CollisionObject
  mStatic : Boolean = false
CollisionObject
  myType : String = ""
CollisionObject
  reactionMode : int = 0
CollisionObject
  useRaycasting : Boolean = false
CollisionObject
Public Methods
 MethodDefined by
  
There is no reason to make an instance of this object.
CollisionObject
  
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 uniform force, moving the entire object.
CollisionObject
  
Applies a force at the given point.
CollisionObject
  
dispose():void
CollisionObject
  
CollisionObject
  
CollisionObject
  
fix(f:Boolean = true):void
Another way of setting the value 'fixed'.
CollisionObject
  
CollisionObject
  
getMaterial():String
The name of the current material applied to the object
CollisionObject
  
CollisionObject
  
getNormalAt(p:Vector, dirVector:Vector = null):Vector
CollisionObject
  
CollisionObject
  
isStatic():Boolean
Returns a value indicating whether or not this object was made static.
CollisionObject
  
makeStatic():void
Makes the object static.
CollisionObject
  
onInit():void
Called after the object is initiated by a FisixObject to which it was added
CollisionObject
  
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.
CollisionObject
  
renderBoundingBox(g:Graphics):void
Renders a rectangle representing the bounding box to the graphics object
CollisionObject
  
setDetectionMode(m:int):void
Sets the collision detection mode to be used by the object
CollisionObject
  
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
  
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
  
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
  
Updates the bounding box of the object.
CollisionObject
Protected Methods
 MethodDefined by
  
Override this function to perform an action after a collision is resolved
CollisionObject
  
afterUnload():void
Override this method to perform actions after the object has been unloaded.
CollisionObject
  
Override this function to perform an action at the time a collision is detected
CollisionObject
  
onUnload():void
Override this method to perform actions once the object is unloaded.
CollisionObject
Property detail
activeproperty
public var 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

bounceproperty 
public var bounce:Number = .5

The object's coefficient of reinstiturion. changing this value overrides the value set by setMaterial().

See also

collidableproperty 
public var 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

colorproperty 
public var color:int = -1

The object's rendering color. changing this value overrides the value set by setMaterial().

See also

detectionModeproperty 
protected var detectionMode:int = 0
dynamicObjectCollisionsproperty 
public var dynamicObjectCollisions:Boolean = false
fixedproperty 
fixed:Boolean  [read-write]

A fixed CollisionObject is never influenced by collisions You may change this value at any time

Implementation
    public function get fixed():Boolean
    public function set fixed(value:Boolean):void
frictionproperty 
public var friction:Number = 0

The object's coefficient of friction. changing this value overrides the value set by setMaterial().

See also

inheritAttributesOnAddproperty 
public var inheritAttributesOnAdd:Boolean = true
lastCollisionproperty 
public var lastCollision:CollisionData

An internal object which stores the information of the object's last collision

magneticproperty 
public var magnetic:Boolean = true

If true, the object is affected by magnets

mFixedproperty 
protected var mFixed:Boolean = false
minXproperty 
public var minX:Number

Hold the dimensions of the object's bounding box. These values should not be set manually

mMaterialproperty 
protected var mMaterial:String
mStaticproperty 
protected var mStatic:Boolean = false
myTypeproperty 
protected var myType:String = ""
nameproperty 
public var name:String = ""
parentproperty 
public var parent:FisixObject

The parent of the object. this value is automatically set when an object is added to a FisixObject, so refrain from changing it manually

See also

raycastproperty 
raycast:Boolean  [read-only]

An internal property, used by the engine

Implementation
    public function get raycast():Boolean
reactionModeproperty 
protected var reactionMode:int = 0
tractionproperty 
public var traction:Number = 1

The object's traction. changing this value overrides the value set by setMaterial().

See also

typeproperty 
type:String  [read-only]

A string representing the type of object you are dealing with

Implementation
    public function get type():String
useRaycastingproperty 
protected var useRaycasting:Boolean = false
Constructor detail
CollisionObject()constructor
public function CollisionObject()

There is no reason to make an instance of this object. it cannot be added to the engine

Method detail
aabbIntersection()method
public function aabbIntersection(obj:CollisionObject):Boolean

Returns whether or not this object's AABB is intersecting with the given object's AABB

Parameters
obj:CollisionObject

Returns
Boolean
afterCollision()method 
protected function afterCollision(data:CollisionData):void

Override this function to perform an action after a collision is resolved

Parameters
data:CollisionData

See also

afterCollision()
afterUnload()method 
protected function afterUnload():void

Override this method to perform actions after the object has been unloaded. This method is called after the object has been removed from the engine and disposed.

applyForce()method 
public function applyForce(f:Vector, checkAA:Boolean = true):void

Applies a uniform force, moving the entire object. Use this method to simulate simple collision impact. For more physically accurate results, use applyForcePoint()

Parameters
f:Vector
 
checkAA:Boolean (default = true)

See also

applyForcePoint()method 
public 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 function dispose():void
fireAfterCollision()method 
public function fireAfterCollision():void
fireOnCollision()method 
public function fireOnCollision():void
fix()method 
public function fix(f:Boolean = true):void

Another way of setting the value 'fixed'. Note that the default value is true, so writing obj.fix() will set obj.fixed to true.

Parameters
f:Boolean (default = true)
getDetectionMode()method 
public function getDetectionMode():int

Returns
int — An integer value representing the object's collision detection mode.

See also

getMaterial()method 
public function getMaterial():String

The name of the current material applied to the object

Returns
String

See also

getNormalAngleAt()method 
public function getNormalAngleAt(p:Vector):NumberParameters
p:Vector

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

Returns
Vector
getReactionMode()method 
public function getReactionMode():int

Returns
int — An integer value representing the object's collision reaction mode.

See also

isStatic()method 
public function isStatic():Boolean

Returns a value indicating whether or not this object was made static.

Returns
Boolean

See also

makeStatic()
makeStatic()method 
public 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

onCollision()method 
protected function onCollision(data:CollisionData):void

Override this function to perform an action at the time a collision is detected

Parameters
data:CollisionData

See also

afterCollision()
onInit()method 
public function onInit():void

Called after the object is initiated by a FisixObject to which it was added

onUnload()method 
protected function onUnload():void

Override this method to perform actions once the object is unloaded. This method is called before anything is actually unloaded

pointForce()method 
public function pointForce(point:Vector, force:Number):void

Applies a force value on the object from the given point. The farther the object is from the point, the less it is affected.

Parameters
point:Vector
 
force:Number
render()method 
public 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
renderBoundingBox()method 
public function renderBoundingBox(g:Graphics):void

Renders a rectangle representing the bounding box to the graphics object

Parameters
g:Graphics — A graphics object to render to
setDetectionMode()method 
public function setDetectionMode(m:int):void

Sets the collision detection mode to be used by the object

Parameters
m:int — an integer representing the collision detection mode.
Use the DetectionModes class's constants as a value

See also

setMaterial()method 
public function setMaterial(mName:String):void

Sets the material of the object This modifies the object's 'friction', 'bounce', 'color' and 'traction' properties.

Parameters
mName:String — the name of the material as given when the material was created

See also

setReactionMode()method 
public function setReactionMode(m:int):void

Sets the collision reaction mode to be used by the object

Parameters
m:int — an integer representing the collision reaction mode.
Use the CollisionModes class's constants as a value

See also

com.fileitup.fisixengine.collisions.CollisionModes
thrust()method 
public function 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. Refrain from using this method to avoid penetration. Instead, use applyForce()

Parameters
tX:Number
 
tY:Number
 
checkAA:Boolean (default = true)

See also

thrustPoint()method 
public 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

See also

unload()method 
public function unload():void

Removes the object from the engine and disposes of it. Use this function to cleanly remove an object from the memory

updateBoundingBox()method 
public 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.