Package | com.fileitup.fisixengine.constraints |
Class | public class AngularConstraint |
Inheritance | AngularConstraint ![]() |
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
Property | Defined by | ||
---|---|---|---|
![]() | breakPoint : Number The point at which a constraint should be broken.
| Constraint | |
![]() | broken : Boolean Tells you whether or not a constraint is currently broken.
| Constraint | |
![]() | max : Number The upper range of the constraint.
| Constraint | |
![]() | min : Number The lower range of the constraint.
| Constraint | |
![]() | parent : FisixObject | Constraint | |
particleA : Particle | AngularConstraint | ||
particleB : Particle | AngularConstraint | ||
particleC : Particle | AngularConstraint | ||
![]() | restLength : Number The length that the constraint will attempt to maintain.
| Constraint | |
![]() | stiffness : Number A value between 0 - 1 representing the stiffness of the constraint.
| Constraint | |
![]() | unloadOnBreak : Boolean = true When true, the constraint is removed from the simulation when broken.
| Constraint |
Method | Defined 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 | ||
![]() |
setMinMax(minimum:Number, maximum:Number):void
Sets both min and max values in one line
| Constraint | |
solve():void
| AngularConstraint | ||
![]() |
unload():void
| Constraint |
Method | Defined by | ||
---|---|---|---|
![]() |
breakConstraint():void
| Constraint | |
![]() |
onBreak():void
| Constraint | |
![]() |
onUnload():void
| Constraint | |
solveConstraint(len:Number, len2:Number):void
| AngularConstraint |
particleA | property |
public var particleA:Particle
particleB | property |
public var particleB:Particle
particleC | property |
public var particleC:Particle
AngularConstraint | () | constructor |
public function AngularConstraint(pA:Particle, pB:Particle, pC:Particle, minA:Number = -1, maxA:Number = -1, breakingPoint:Number = 0)
Creates an AngularConstraint object.
ParameterspA: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
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.
ReturnsNumber |
getCenter | () | method |
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):void
Parameters
len:Number |
|
len2:Number |