Developer   API   Game Development   Box2D   PhysicsContact

PhysicsContact

The class manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered). Therefore a contact object may exist that has no contact points.

Properties

  • densityA : Float
    Density of the first body.
  • enabled : Boolean
    Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the current time step (or sub-step in continuous collisions).
  • frictionA : Float
    Friction of the first body.
  • frictionB : Float
    Friction of the second body.
  • isTouching : Boolean
    Is this contact touching?
  • native : b2Contact
    Moscrif native instance of b2Contact.
  • restitutionA : Float
    Restitution of the first body.
  • restitutionB : Float
    Restitution of the second body.

Methods

  • getBodyA : b2Body
    Get the first body in the contact.
  • getBodyB : b2Body
    Get the second body in the contact.
  • getNext : b2Body
    Get the next contact in the world's contact list.
  • this(world, nativeContact) : PhysicsContact
    Create an instance of physics contact.
API Navigation