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

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

public class WheelJoint
extends Joint

A wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in body1 and rotation in the plane. You can use a joint limit to restrict the range of motion and a joint motor to drive the rotation or to model rotational friction. This joint is designed for vehicle suspensions.


Constructor Summary
WheelJoint(World world, long addr)
           
 
Method Summary
 void enableMotor(boolean flag)
          Enable/disable the joint motor.
 float getJointSpeed()
          Get the current joint translation speed, usually in meters per second.
 float getJointTranslation()
          Get the current joint translation, usually in meters.
 float getMaxMotorTorque()
           
 float getMotorSpeed()
          Get the motor speed, usually in radians per second.
 float getMotorTorque(float invDt)
          Get the current motor torque given the inverse time step, usually in N-m.
 float getSpringDampingRatio()
           
 float getSpringFrequencyHz()
           
 void setMaxMotorTorque(float torque)
          Set/Get the maximum motor force, usually in N-m.
 void setMotorSpeed(float speed)
          Set the motor speed, usually in radians per second.
 void setSpringDampingRatio(float ratio)
          Set/Get the spring damping ratio
 void setSpringFrequencyHz(float hz)
          Set/Get the spring frequency in hertz.
 
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

WheelJoint

public WheelJoint(World world,
                  long addr)
Method Detail

getJointTranslation

public float getJointTranslation()
Get the current joint translation, usually in meters.


getJointSpeed

public float getJointSpeed()
Get the current joint translation speed, usually in meters per second.


enableMotor

public void enableMotor(boolean flag)
Enable/disable the joint motor.


setMotorSpeed

public void setMotorSpeed(float speed)
Set the motor speed, usually in radians per second.


getMotorSpeed

public float getMotorSpeed()
Get the motor speed, usually in radians per second.


setMaxMotorTorque

public void setMaxMotorTorque(float torque)
Set/Get the maximum motor force, usually in N-m.


getMaxMotorTorque

public float getMaxMotorTorque()

getMotorTorque

public float getMotorTorque(float invDt)
Get the current motor torque given the inverse time step, usually in N-m.


setSpringFrequencyHz

public void setSpringFrequencyHz(float hz)
Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring.


getSpringFrequencyHz

public float getSpringFrequencyHz()

setSpringDampingRatio

public void setSpringDampingRatio(float ratio)
Set/Get the spring damping ratio


getSpringDampingRatio

public float getSpringDampingRatio()


Copyright © 2013. All Rights Reserved.