Class CollisionManager

java.lang.Object
com.mygdx.game.Managers.CollisionManager
All Implemented Interfaces:
com.badlogic.gdx.physics.box2d.ContactListener

public class CollisionManager
extends java.lang.Object
implements com.badlogic.gdx.physics.box2d.ContactListener
Handels collision callbacks for box2d
  • Constructor Summary

    Constructors
    Constructor Description
    CollisionManager()  
  • Method Summary

    Modifier and Type Method Description
    void beginContact​(com.badlogic.gdx.physics.box2d.Contact contact)
    called for every contact that box2d detects prior to collision restitution (doesn't matter if it is a trigger/sensor)
    void endContact​(com.badlogic.gdx.physics.box2d.Contact contact)
    called for every contact that box2d detects after collision restitution (doesn't matter if it is a trigger/sensor)
    void postSolve​(com.badlogic.gdx.physics.box2d.Contact contact, com.badlogic.gdx.physics.box2d.ContactImpulse impulse)  
    void preSolve​(com.badlogic.gdx.physics.box2d.Contact contact, com.badlogic.gdx.physics.box2d.Manifold oldManifold)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CollisionManager

      public CollisionManager()
  • Method Details

    • beginContact

      public void beginContact​(com.badlogic.gdx.physics.box2d.Contact contact)
      called for every contact that box2d detects prior to collision restitution (doesn't matter if it is a trigger/sensor)
      Specified by:
      beginContact in interface com.badlogic.gdx.physics.box2d.ContactListener
      Parameters:
      contact - the contact data
    • endContact

      public void endContact​(com.badlogic.gdx.physics.box2d.Contact contact)
      called for every contact that box2d detects after collision restitution (doesn't matter if it is a trigger/sensor)
      Specified by:
      endContact in interface com.badlogic.gdx.physics.box2d.ContactListener
      Parameters:
      contact - the contact data
    • preSolve

      public void preSolve​(com.badlogic.gdx.physics.box2d.Contact contact, com.badlogic.gdx.physics.box2d.Manifold oldManifold)
      Specified by:
      preSolve in interface com.badlogic.gdx.physics.box2d.ContactListener
    • postSolve

      public void postSolve​(com.badlogic.gdx.physics.box2d.Contact contact, com.badlogic.gdx.physics.box2d.ContactImpulse impulse)
      Specified by:
      postSolve in interface com.badlogic.gdx.physics.box2d.ContactListener