public class MouseJointAdapter
extends com.badlogic.gdx.InputAdapter
InputAdapter managing a MouseJoint| Modifier and Type | Class and Description |
|---|---|
static interface |
MouseJointAdapter.Listener
|
class |
MouseJointAdapter.Manager
Manages
MouseJointAdapters by creating new ones if necessary. |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
adaptMaxForceToBodyMass
|
private com.badlogic.gdx.graphics.Camera |
camera
the
Camera used to convert to world coordinates |
static MouseJointAdapter.Listener |
defaultListener
the
listener used by default |
private com.badlogic.gdx.physics.box2d.joints.MouseJoint |
joint
the managed
MouseJoint |
private com.badlogic.gdx.physics.box2d.joints.MouseJointDef |
jointDef
the
MouseJointDef used to create joint |
private MouseJointAdapter.Listener |
listener
the
MouseJointAdapter.Listener called by queryCallback |
private boolean |
mouseMoved
|
private byte |
pointer
The pointer to react to.
|
private com.badlogic.gdx.physics.box2d.QueryCallback |
queryCallback
|
private static com.badlogic.gdx.math.Vector2 |
vec2_0
for internal, temporary usage
|
private static com.badlogic.gdx.math.Vector2 |
vec2_1
for internal, temporary usage
|
private com.badlogic.gdx.math.Vector3 |
vec3
for internal, temporary usage
|
| Constructor and Description |
|---|
MouseJointAdapter(MouseJointAdapter other)
constructs a new
MouseJointAdapter that equals the given other one |
MouseJointAdapter(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef,
boolean adaptMaxForceToBodyMass,
com.badlogic.gdx.graphics.Camera camera)
constructs a
MouseJointAdapter with pointer set to 0 (useful for desktop) |
MouseJointAdapter(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef,
boolean adaptMaxForceToBodyMass,
com.badlogic.gdx.graphics.Camera camera,
byte pointer)
constructs a
MouseJointAdapter using the given MouseJointDef |
| Modifier and Type | Method and Description |
|---|---|
com.badlogic.gdx.graphics.Camera |
getCamera() |
com.badlogic.gdx.physics.box2d.joints.MouseJoint |
getJoint() |
com.badlogic.gdx.physics.box2d.joints.MouseJointDef |
getJointDef() |
MouseJointAdapter.Listener |
getListener() |
byte |
getPointer() |
boolean |
isAdaptMaxForceToBodyMass() |
boolean |
isMouseMoved() |
boolean |
mouseMoved(int screenX,
int screenY)
|
boolean |
reactsToPointer(int pointer) |
void |
setAdaptMaxForceToBodyMass(boolean adaptMaxForceToBodyMass) |
void |
setCamera(com.badlogic.gdx.graphics.Camera camera) |
void |
setJoint(com.badlogic.gdx.physics.box2d.joints.MouseJoint joint) |
void |
setJointDef(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef) |
void |
setListener(MouseJointAdapter.Listener listener) |
void |
setMouseMoved(boolean mouseMoved) |
void |
setPointer(byte pointer) |
boolean |
touchDown(int screenX,
int screenY,
int pointer,
int button)
|
boolean |
touchDragged(int screenX,
int screenY,
int pointer)
|
boolean |
touchUp(int screenX,
int screenY,
int pointer,
int button)
|
private byte pointer
public static final MouseJointAdapter.Listener defaultListener
listener used by defaultprivate MouseJointAdapter.Listener listener
MouseJointAdapter.Listener called by queryCallbackprivate com.badlogic.gdx.graphics.Camera camera
Camera used to convert to world coordinatesprivate boolean adaptMaxForceToBodyMass
private boolean mouseMoved
private com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef
MouseJointDef used to create jointprivate com.badlogic.gdx.physics.box2d.joints.MouseJoint joint
MouseJointprivate final com.badlogic.gdx.math.Vector3 vec3
private static final com.badlogic.gdx.math.Vector2 vec2_0
private static final com.badlogic.gdx.math.Vector2 vec2_1
private final com.badlogic.gdx.physics.box2d.QueryCallback queryCallback
public MouseJointAdapter(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef,
boolean adaptMaxForceToBodyMass,
com.badlogic.gdx.graphics.Camera camera)
MouseJointAdapter with pointer set to 0 (useful for desktop)public MouseJointAdapter(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef,
boolean adaptMaxForceToBodyMass,
com.badlogic.gdx.graphics.Camera camera,
byte pointer)
MouseJointAdapter using the given MouseJointDefjointDef - The MouseJointDef to use. Note that its bodyB will be changed by the MouseJointAdapter so it can be null but bodyA has to be set!adaptMaxForceToBodyMass - the adaptMaxForceToBodyMasscamera - the camerapointer - the pointerpublic MouseJointAdapter(MouseJointAdapter other)
MouseJointAdapter that equals the given other onepublic boolean touchDown(int screenX,
int screenY,
int pointer,
int button)
touchDown in interface com.badlogic.gdx.InputProcessortouchDown in class com.badlogic.gdx.InputAdapterpublic boolean touchDragged(int screenX,
int screenY,
int pointer)
touchDragged in interface com.badlogic.gdx.InputProcessortouchDragged in class com.badlogic.gdx.InputAdapterpublic boolean mouseMoved(int screenX,
int screenY)
mouseMoved in interface com.badlogic.gdx.InputProcessormouseMoved in class com.badlogic.gdx.InputAdapterpublic boolean touchUp(int screenX,
int screenY,
int pointer,
int button)
touchUp in interface com.badlogic.gdx.InputProcessortouchUp in class com.badlogic.gdx.InputAdapterpublic boolean reactsToPointer(int pointer)
public byte getPointer()
pointerpublic void setPointer(byte pointer)
pointer - the pointer to setpublic MouseJointAdapter.Listener getListener()
listenerpublic void setListener(MouseJointAdapter.Listener listener)
listener - the listener to setpublic com.badlogic.gdx.graphics.Camera getCamera()
camerapublic void setCamera(com.badlogic.gdx.graphics.Camera camera)
camera - the camera to setpublic boolean isAdaptMaxForceToBodyMass()
adaptMaxForceToBodyMasspublic void setAdaptMaxForceToBodyMass(boolean adaptMaxForceToBodyMass)
adaptMaxForceToBodyMass - the adaptMaxForceToBodyMass to setpublic boolean isMouseMoved()
mouseMovedpublic void setMouseMoved(boolean mouseMoved)
mouseMoved - the mouseMoved to setpublic com.badlogic.gdx.physics.box2d.joints.MouseJointDef getJointDef()
jointDefpublic void setJointDef(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef)
jointDef - the jointDef to setpublic com.badlogic.gdx.physics.box2d.joints.MouseJoint getJoint()
jointpublic void setJoint(com.badlogic.gdx.physics.box2d.joints.MouseJoint joint)
joint - the joint to set