Class MouseJointAdapter

java.lang.Object
com.badlogic.gdx.InputAdapter
net.dermetfan.gdx.physics.box2d.MouseJointAdapter
All Implemented Interfaces:
com.badlogic.gdx.InputProcessor

public class MouseJointAdapter
extends com.badlogic.gdx.InputAdapter
an InputAdapter managing a MouseJoint
  • Constructor Details

  • Method Details

    • touchDown

      public boolean touchDown​(int screenX, int screenY, int pointer, int button)
      uses queryCallback to create joint if joint is null
      Specified by:
      touchDown in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDown in class com.badlogic.gdx.InputAdapter
    • touchDragged

      public boolean touchDragged​(int screenX, int screenY, int pointer)
      updates the target of joint if dragged of listener returns true
      Specified by:
      touchDragged in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDragged in class com.badlogic.gdx.InputAdapter
    • mouseMoved

      public boolean mouseMoved​(int screenX, int screenY)
      calls touchDragged(int, int, int) with pointer if mouseMoved is true
      Specified by:
      mouseMoved in interface com.badlogic.gdx.InputProcessor
      Overrides:
      mouseMoved in class com.badlogic.gdx.InputAdapter
    • touchUp

      public boolean touchUp​(int screenX, int screenY, int pointer, int button)
      destroys joint if released of listener returns true
      Specified by:
      touchUp in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchUp in class com.badlogic.gdx.InputAdapter
    • reactsToPointer

      public boolean reactsToPointer​(int pointer)
      Returns:
      if this MouseJointAdapter reacts to the specified pointer
    • getPointer

      public byte getPointer()
      Returns:
      the pointer
    • setPointer

      public void setPointer​(byte pointer)
      Parameters:
      pointer - the pointer to set
    • getListener

      public MouseJointAdapter.Listener getListener()
      Returns:
      the listener
    • setListener

      public void setListener​(MouseJointAdapter.Listener listener)
      Parameters:
      listener - the listener to set
    • getCamera

      public com.badlogic.gdx.graphics.Camera getCamera()
      Returns:
      the camera
    • setCamera

      public void setCamera​(com.badlogic.gdx.graphics.Camera camera)
      Parameters:
      camera - the camera to set
    • isAdaptMaxForceToBodyMass

      public boolean isAdaptMaxForceToBodyMass()
      Returns:
      the adaptMaxForceToBodyMass
    • setAdaptMaxForceToBodyMass

      public void setAdaptMaxForceToBodyMass​(boolean adaptMaxForceToBodyMass)
      Parameters:
      adaptMaxForceToBodyMass - the adaptMaxForceToBodyMass to set
    • isMouseMoved

      public boolean isMouseMoved()
      Returns:
      the mouseMoved
    • setMouseMoved

      public void setMouseMoved​(boolean mouseMoved)
      Parameters:
      mouseMoved - the mouseMoved to set
    • getJointDef

      public com.badlogic.gdx.physics.box2d.joints.MouseJointDef getJointDef()
      Returns:
      the jointDef
    • setJointDef

      public void setJointDef​(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef)
      Parameters:
      jointDef - the jointDef to set
    • getJoint

      public com.badlogic.gdx.physics.box2d.joints.MouseJoint getJoint()
      Returns:
      the joint
    • setJoint

      public void setJoint​(com.badlogic.gdx.physics.box2d.joints.MouseJoint joint)
      Parameters:
      joint - the joint to set