libgdx API

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

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

public class PrismaticJoint
extends Joint

A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.


Field Summary
 
Fields inherited from class com.badlogic.gdx.physics.box2d.Joint
addr, jointEdgeA, jointEdgeB
 
Constructor Summary
PrismaticJoint(World world, long addr)
           
 
Method Summary
 void enableLimit(boolean flag)
          Enable/disable the joint limit.
 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 getLowerLimit()
          Get the lower joint limit, usually in meters.
 float getMotorForce(float invDt)
          Get the current motor force given the inverse time step, usually in N.
 float getMotorSpeed()
          Get the motor speed, usually in meters per second.
 float getUpperLimit()
          Get the upper joint limit, usually in meters.
 boolean isLimitEnabled()
          Is the joint limit enabled?
 boolean isMotorEnabled()
          Is the joint motor enabled?
 void setLimits(float lower, float upper)
          Set the joint limits, usually in meters.
 void setMaxMotorForce(float force)
          Set the maximum motor force, usually in N.
 void setMotorSpeed(float speed)
          Set the motor speed, usually in meters per second.
 
Methods inherited from class com.badlogic.gdx.physics.box2d.Joint
getAnchorA, getAnchorB, getBodyA, getBodyB, getReactionForce, getReactionTorque, getType, isActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrismaticJoint

public PrismaticJoint(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.


isLimitEnabled

public boolean isLimitEnabled()
Is the joint limit enabled?


enableLimit

public void enableLimit(boolean flag)
Enable/disable the joint limit.


getLowerLimit

public float getLowerLimit()
Get the lower joint limit, usually in meters.


getUpperLimit

public float getUpperLimit()
Get the upper joint limit, usually in meters.


setLimits

public void setLimits(float lower,
                      float upper)
Set the joint limits, usually in meters.


isMotorEnabled

public boolean isMotorEnabled()
Is the joint motor enabled?


enableMotor

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


setMotorSpeed

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


getMotorSpeed

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


setMaxMotorForce

public void setMaxMotorForce(float force)
Set the maximum motor force, usually in N.


getMotorForce

public float getMotorForce(float invDt)
Get the current motor force given the inverse time step, usually in N.


libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)