Packageorg.MARS.dynamics.collision
Classpublic class Contact

Depicts pairwise contact information

To resolve collisions, the CollisionResolver needs to know both bodies involved, the point of contact in world coordinates, and the collision normal (points outward from incident edge).

TODO: This needs to eventually be generalized to allow for particles

See also

PolygonPolygonDetector.getContacts
CollisionResolver


Public Properties
 PropertyDefined by
  body1 : IBody
First body involved in collision (arbitrary)
Contact
  body2 : IBody
Second body involved in collision (arbitrary)
Contact
  normal : Vector
Collision normal
Contact
  position : Vector
Point of contact in world coordinates
Contact
Public Methods
 MethodDefined by
  
Contact(position:Vector, body1:IBody, body2:IBody, normal:Vector)
Creates a new contact
Contact
Property detail
body1property
public var body1:IBody

First body involved in collision (arbitrary)

body2property 
public var body2:IBody

Second body involved in collision (arbitrary)

normalproperty 
public var normal:Vector

Collision normal

positionproperty 
public var position:Vector

Point of contact in world coordinates

Constructor detail
Contact()constructor
public function Contact(position:Vector, body1:IBody, body2:IBody, normal:Vector)

Creates a new contact

Parameters
position:Vector — point of contact in world coordinates
 
body1:IBody — first body involved in collision
 
body2:IBody — second body involved in collision
 
normal:Vector — contact normal