com.badlogic.gdx.physics.box2d.joints
Class MouseJoint

java.lang.Object
  extended by com.badlogic.gdx.physics.box2d.Joint
      extended by com.badlogic.gdx.physics.box2d.joints.MouseJoint

public class MouseJoint
extends Joint

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces. NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.


Constructor Summary
MouseJoint(World world, long addr)
           
 
Method Summary
 float getDampingRatio()
          Set/get the damping ratio (dimensionless).
 float getFrequency()
          Set/get the frequency in Hertz.
 float getMaxForce()
          Set/get the maximum force in Newtons.
 Vector2 getTarget()
           
 void setDampingRatio(float ratio)
          Set/get the damping ratio (dimensionless).
 void setFrequency(float hz)
          Set/get the frequency in Hertz.
 void setMaxForce(float force)
          Set/get the maximum force in Newtons.
 void setTarget(Vector2 target)
          Use this to update the target point.
 
Methods inherited from class com.badlogic.gdx.physics.box2d.Joint
getAnchorA, getAnchorB, getBodyA, getBodyB, getReactionForce, getReactionTorque, getType, getUserData, isActive, setUserData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseJoint

public MouseJoint(World world,
                  long addr)
Method Detail

setTarget

public void setTarget(Vector2 target)
Use this to update the target point.


getTarget

public Vector2 getTarget()

setMaxForce

public void setMaxForce(float force)
Set/get the maximum force in Newtons.


getMaxForce

public float getMaxForce()
Set/get the maximum force in Newtons.


setFrequency

public void setFrequency(float hz)
Set/get the frequency in Hertz.


getFrequency

public float getFrequency()
Set/get the frequency in Hertz.


setDampingRatio

public void setDampingRatio(float ratio)
Set/get the damping ratio (dimensionless).


getDampingRatio

public float getDampingRatio()
Set/get the damping ratio (dimensionless).



Copyright © 2013. All Rights Reserved.