A native flash event class for handling Box2d contact events. If a fixture's user data implements
IEventDispatcher (for example, if m_userData is a MovieClip), that event dispatcher will be used
to broadcast contact events involving the fixture.
GOTCHA: A fixture will only dispatch contact events if reportBeginContact, reportEndContact, etc. are set to true.
public static var BEGIN_CONTACT:String = onBeginContact
public var contact:b2Contact
public static var END_CONTACT:String = onEndContact
public var fixture:b2Fixture
public var impulses:b2ContactImpulse
normal:V2
[read-only]
Get the world normal of the contact that points from fixture to other.
Implementation public function get normal():V2
public var oldManifold:b2Manifold
public var other:b2Fixture
point:V2
[read-only]
Get the world point of contact (for 2-point contacts, this is the average).
Implementation public function get point():V2
pointCount:uint
[read-only]
Get the point count from the contact.
Implementation public function get pointCount():uint
public static var POST_SOLVE:String = onPostSolve
public static var PRE_SOLVE:String = onPreSolve
public var relatedObject:*
public var worldManifold:b2WorldManifold
public var worldManifoldTime:int
public function ContactEvent(t:String, c:b2Contact, bi:int, o:b2Manifold = null, i:b2ContactImpulse = null)
Parameters public function applyForce(base:Number, massFactor:Number = 0, self:Boolean = false):void
Applies a force to the other body in the direction of the normal.
Parameters
| base:Number |
|
| massFactor:Number (default = 0 )
|
|
| self:Boolean (default = false )
|
public function applyImpulse(base:Number, massFactor:Number = 0):void
Applies an impulse to the other body in the direction of the normal.
Parameters
| base:Number |
|
| massFactor:Number (default = 0 )
|
override public function clone():Event
Clone the event for re-dispatching.
Returns public function getWorldManifold():b2WorldManifold
Returns the world manifold. Very important if you plan on actually doing anything significant
with contacts. The normal will be oriented based on "bias" so that it is always pointing from
the target fixture to the other fixture. This way you don't have to worry about the direction of the
normal.
Returns public function isSolid():Boolean
Returns true if the contacts is touching, is not a sensor, and has not been disabled.
Returnsoverride public function preventDefault():void
Disables a contact by setting it as a sensor for the life of the contact.
public function update():void
Update the contact. This ensures the contact has the right, current information.
Sun Apr 17 2011, 12:17 AM -07:00