PackageBox2D.Dynamics
Classpublic class b2ContactFilter
Sourceb2ContactFilter.as

Implement this class to provide collision filtering. In other words, you can implement this class if you want finer control over contact creation.



Public Methods
 MethodDefined by
  
RayCollide(userData:*, shape:b2Shape):Boolean
Return true if the given shape should be considered for ray intersection.
b2ContactFilter
  
ShouldCollide(shape1:b2Shape, shape2:b2Shape):Boolean
Return true if contact calculations should be performed between these two shapes.
b2ContactFilter
Method detail
RayCollide()method
public function RayCollide(userData:*, shape:b2Shape):Boolean

Return true if the given shape should be considered for ray intersection. By default, userData is cast as a b2Shape and collision is resolved according to ShouldCollide

Parameters
userData:* — arbitrary data passed from Raycast or RaycastOne
 
shape:b2Shape — the shape that we are testing for filtering

Returns
Boolean — a Boolean, with a value of false indicating that this shape should be ignored.

See also

ShouldCollide()
b2World.Raycast
ShouldCollide()method 
public function ShouldCollide(shape1:b2Shape, shape2:b2Shape):Boolean

Return true if contact calculations should be performed between these two shapes.

Warning: for performance reasons this is only called when the AABBs begin to overlap.

Parameters
shape1:b2Shape
 
shape2:b2Shape

Returns
Boolean