PackageBox2D.Collision
Classpublic class b2Segment
Sourceb2Segment.as

A line in space between two given vertices.



Public Properties
 PropertyDefined by
  p1 : b2Vec2
The starting point
b2Segment
  p2 : b2Vec2
The ending point
b2Segment
Public Methods
 MethodDefined by
  
Extend(aabb:b2AABB):void
Extends or clips the segment so that it's ends lie on the boundary of the AABB
b2Segment
  
b2Segment
  
ExtendForward(aabb:b2AABB):void
b2Segment
  
TestSegment(lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean
Ray cast against this segment with another segment
b2Segment
Property detail
p1property
public var p1:b2Vec2

The starting point

p2property 
public var p2:b2Vec2

The ending point

Method detail
Extend()method
public function Extend(aabb:b2AABB):void

Extends or clips the segment so that it's ends lie on the boundary of the AABB

Parameters
aabb:b2AABB
ExtendBackward()method 
public function ExtendBackward(aabb:b2AABB):void

Parameters
aabb:b2AABB

See also

Extend
ExtendForward()method 
public function ExtendForward(aabb:b2AABB):void

Parameters
aabb:b2AABB

See also

Extend
TestSegment()method 
public function TestSegment(lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean

Ray cast against this segment with another segment

Parameters
lambda:Array — the shape world transform.
 
normal:b2Vec2 — returns the hit fraction. You can use this to compute the contact point p = (1 - lambda) segment.p1 + lambda segment.p2.
 
segment:b2Segment — returns the normal at the contact point. If there is no intersection, the normal is not set.
 
maxLambda:Number — defines the begin and end point of the ray cast.

Returns
Boolean — true if there was an intersection.

See also