A utility class for various calculation involving line segments
distance:Number [read-only]
Also, stores the length in 'lastDistance'
This is useful when retrieving the distance of a static line
and trying to avoid redundant sqrt() operations
Implementation
public function get distance():Number
public var lastDistance:Number = 0
public var lastNormal:Vector
vector:Vector [read-only]
Implementation
public function get vector():Vector
public var vectorA:Vector
public function Line(vA:Vector, vB:Vector)Parameters
public function addVector(v:Vector):voidtranslates both vectors of the line by the given vector
Parameters
public function getNormal():VectorCalculates the right-hand normal of the vector
Returns
public function pointOnLine(t:Number, limitToEnds:Boolean = true):VectorFinds a point on the line from a given percentage
Parameters
| t:Number — the percentage on the line (usually between 0-1)
where 0 returns the position of vectorA and 1 returns the position of vetorB
|
| |
| limitToEnds:Boolean (default = true) — if true, the t value is clipped between 0 and 1
|
Returns
| Vector —
A vector containing the x,y position of a point on a line
|
public function render(g:Graphics):voidDraws a line between the two points of the line on the given Graphics object
Parameters
FisixEngine 0.5a Documentation. For more engine support, visit www.fisixengine.com
Thu Dec 14 2006, 9:48 PM GMT-05:00