PackageBox2D.Collision
Classpublic class b2Segment

A manifold for two touching convex shapes.



Public Properties
 PropertyDefined by
  p1 : b2Vec2
b2Segment
  p2 : b2Vec2
b2Segment
Public Methods
 MethodDefined by
  
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
p2property 
public var p2:b2Vec2
Method detail
TestSegment()method
public function TestSegment(lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean

Ray cast against this segment with another segment. Collision Detection in Interactive 3D Environments by Gino van den Bergen From Section 3.4.1 x = mu1 p1 + mu2 p2 mu1 + mu2 = 1 && mu1 >= 0 && mu2 >= 0 mu1 = 1 - mu2; x = (1 - mu2) p1 + mu2 p2 = p1 + mu2 (p2 - p1) x = s + a r (s := start, r := end - start) s + a r = p1 + mu2 d (d := p2 - p1) -a r + mu2 d = b (b := s - p1) [-r d] [a; mu2] = b Cramer's rule: denom = det[-r d] a = det[b d] / denom mu2 = det[-r b] / denom

Parameters
lambda:Array
 
normal:b2Vec2
 
segment:b2Segment
 
maxLambda:Number

Returns
Boolean