Packagecom.fileitup.fisixengine.constraints
Classpublic class AngularConstraint
InheritanceAngularConstraint Inheritance Constraint

A constraint which holds 3 objects within the given relative angles.

Angular constraints are built from 3 points. The first and last are on the side of the constraints
The middle point (particleB) is the pivot point.
The angle in an angular constraint is measured between 0 - 360 and is never negative.
When all three points lie on the same line, the angle is 0 (or 360)
the angle increases as the segment between particleB and particleC rotates clockwise

Note that in their nature, angular constraints are not as stable as spring constraints. Always use springs over angular constraints where possible. Angular constraints work well when spread out over a few particles. Generally, refrain from angular constrainting over the same object more than 3 different times

For more general constraint features like breakable constraints, see the Constraint class

See also

com.fileitup.fisixengine.primitives.Constraint


Public Properties
 PropertyDefined by
 InheritedbreakPoint : Number
The point at which a constraint should be broken.
Constraint
 Inheritedbroken : Boolean
Tells you whether or not a constraint is currently broken.
Constraint
 Inheritedmax : Number
The upper range of the constraint.
Constraint
 Inheritedmin : Number
The lower range of the constraint.
Constraint
 Inheritedparent : FisixObject
Constraint
  particleA : Particle
AngularConstraint
  particleB : Particle
AngularConstraint
  particleC : Particle
AngularConstraint
 InheritedrestLength : Number
The length that the constraint will attempt to maintain.
Constraint
 Inheritedstiffness : Number
A value between 0 - 1 representing the stiffness of the constraint.
Constraint
 InheritedunloadOnBreak : Boolean = true
When true, the constraint is removed from the simulation when broken.
Constraint
Public Methods
 MethodDefined by
  
AngularConstraint(pA:Particle, pB:Particle, pC:Particle, minA:Number = -1, maxA:Number = -1, breakingPoint:Number = 0)
Creates an AngularConstraint object.
AngularConstraint
  
dispose():void
AngularConstraint
  
flip():void
Flips the constraint's restLength values.
AngularConstraint
  
getAngle():Number
Finds the current angle between all 3 points of the constraint.
AngularConstraint
  
AngularConstraint
  
render(g:Graphics):void
AngularConstraint
 Inherited
setMinMax(minimum:Number, maximum:Number):void
Sets both min and max values in one line
Constraint
  
solve():void
AngularConstraint
 Inherited
unload():void
Constraint
Protected Methods
 MethodDefined by
 Inherited
Constraint
 Inherited
onBreak():void
Constraint
 Inherited
onUnload():void
Constraint
  
solveConstraint(len:Number, len2:Number):void
AngularConstraint
Property detail
particleAproperty
public var particleA:Particle
particleBproperty 
public var particleB:Particle
particleCproperty 
public var particleC:Particle
Constructor detail
AngularConstraint()constructor
public function AngularConstraint(pA:Particle, pB:Particle, pC:Particle, minA:Number = -1, maxA:Number = -1, breakingPoint:Number = 0)

Creates an AngularConstraint object.

Parameters
pA:Particle — The object on the first edge of the angular constraint.
 
pB:Particle — The object to serve as the pivot of the angular constraint.
 
pC:Particle — The object to serve as the second edge of the angular constraint.
 
minA:Number (default = -1) — The minimum angle of the constraint, a value between 0 - 360. leave at default (-1) to let the angle go under any value.
 
maxA:Number (default = -1) — The maximum angle of the constraint, a value between 0 - 360. leave at default (-1) to let the angle go above any value.
 
breakingPoint:Number (default = 0)

See also

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

flip()method 
public function flip():void

Flips the constraint's restLength values. This is most usefull when attempting to flip a FisixObject

See also

getAngle()method 
public function getAngle():Number

Finds the current angle between all 3 points of the constraint.

Returns
Number
getCenter()method 
public function getCenter():Vector

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

Parameters
g:Graphics
solve()method 
public override function solve():void
solveConstraint()method 
protected override function solveConstraint(len:Number, len2:Number):voidParameters
len:Number
 
len2:Number