Packageflare.physics
Classpublic class Contact
InheritanceContact Inheritance Object

A structure which defines and solves a contact point between two colliders. Contacts are not persistent objects, once a testing phase is finished and a new one is started, contacts are reused and they could store completelly different information, even different colliders. so it is not a good idea storing contact references for future uses.

See also

ContactData


Public Properties
 PropertyDefined By
  collider0 : Collider
First of two colliders involved in this contact.
Contact
  collider1 : Collider
Second of two colliders involved in this contact.
Contact
  depth : Number
Max amount of overlaping between the two colliders when more than one contact is invoved.
Contact
  edge : Edge
The triangle edge involved in this contact if any.
Contact
  normalX : Number
X-Axis normal in world space.
Contact
  normalY : Number
Y-Axis normal in world space.
Contact
  normalZ : Number
Z-Axis Normal in world space.
Contact
  overlap : Number
Amount of overlaping between the two colliders for this contact.
Contact
  parent0 : Collider
First of two parent colliders if any, where all the impulses and transformations will be applied.
Contact
  parent1 : Collider
Second of two parent colliders if any, where all the impulses and transformations will be applied.
Contact
  posX : Number
X-Axis position in world space.
Contact
  posY : Number
Y-Axis position in world space.
Contact
  posZ : Number
Z-Axis position in world space.
Contact
  tri : Triangle
The triangle involved in this contact if any.
Contact
Public Methods
 MethodDefined By
  
Creates a new contact point.
Contact
  
preSolve():void
Does all the mathematical computations needed for the solving phase.
Contact
  
solve():void
Solves one iteration of the contact.
Contact
Property Detail
collider0property
public var collider0:Collider

First of two colliders involved in this contact. Colliders are stored in no specific order and could be swapped at any time. For uni-directional data, see ContactData class

See also

collider1property 
public var collider1:Collider

Second of two colliders involved in this contact. Colliders are stored in no specific order and could be swapped at any time. For uni-directional data, see ContactData class

See also

depthproperty 
public var depth:Number

Max amount of overlaping between the two colliders when more than one contact is invoved.

edgeproperty 
public var edge:Edge

The triangle edge involved in this contact if any.

normalXproperty 
public var normalX:Number

X-Axis normal in world space.

normalYproperty 
public var normalY:Number

Y-Axis normal in world space.

normalZproperty 
public var normalZ:Number

Z-Axis Normal in world space.

overlapproperty 
public var overlap:Number

Amount of overlaping between the two colliders for this contact.

parent0property 
public var parent0:Collider

First of two parent colliders if any, where all the impulses and transformations will be applied. A child collider has no effect on itself, but on its parent.

parent1property 
public var parent1:Collider

Second of two parent colliders if any, where all the impulses and transformations will be applied. A child collider has no effect on itself, but on its parent.

posXproperty 
public var posX:Number

X-Axis position in world space.

posYproperty 
public var posY:Number

Y-Axis position in world space.

posZproperty 
public var posZ:Number

Z-Axis position in world space.

triproperty 
public var tri:Triangle

The triangle involved in this contact if any.

Constructor Detail
Contact()Constructor
public function Contact()

Creates a new contact point. Contacts are created automatically by the physics engine, you don't need to create these manually.

Method Detail
preSolve()method
public final function preSolve():void

Does all the mathematical computations needed for the solving phase.

solve()method 
public final function solve():void

Solves one iteration of the contact.