org.xith3d.physics.simulation
Class JointLimitMotor

java.lang.Object
  extended by org.xith3d.physics.simulation.JointLimitMotor

public class JointLimitMotor
extends java.lang.Object

With JointLimitMotor limits can be attached to Joints, but also motor-like behaviour.

If you want to use the limit functionality of JointLimitMotor, you have to set lostop and histop.

If you want to use it as a motor, you have to set vel and fmax, where
vel is the speed to which the Joint should reach
fmax is the force that maximally can be applied to reach this target, by default this is zero, so setting vel alone does not suffice. Joints, where limits and motor functionality are possible have a field(s) containing the JointLimitMotor, so as a user you won't have to call the constructor yourself.


Constructor Summary
protected JointLimitMotor(float defaultCFM, float defaultERP)
          creates a new JointLimitMotor You normally won't have to call this.
 
Method Summary
 float getBounce()
           
 float getFudgeFactor()
           
 float getHighStop()
           
 int getLimit()
          variables used between getInfo1() and getInfo2() 0=free, 1=at lo limit, 2=at hi limit
 float getLimitError()
           
 float getLowStop()
           
 float getMaxForce()
           
 float getNormalCFM()
           
 float getStopCFM()
           
 float getStopERP()
           
 float getVelocity()
           
 boolean isDirty()
           
 void makeClean()
           
 void setBounce(float bounce)
          restitution factor
 void setFudgeFactor(float fudgeFactor)
          when powering away from joint limits
 void setHighStop(float hiStop)
          joint limit : hi stop (relative to initial)
 void setLimit(int limit)
          variables used between getInfo1() and getInfo2() 0=free, 1=at lo limit, 2=at hi limit
 void setLimitError(float limitErr)
          if at limit, amount over limit
 void setLowStop(float lowStop)
          joint limit : lo stop (relative to initial)
 void setMaxForce(float maxForce)
          powered joint : max force
 void setNormalCFM(float normalCFM)
          cfm to use when not at a stop
 void setStopCFM(float stopCFM)
          cfm for when at joint limit
 void setStopERP(float stopERP)
          erp for when at joint limit
 void setVelocity(float velocity)
          powered joint : velocity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JointLimitMotor

protected JointLimitMotor(float defaultCFM,
                          float defaultERP)
creates a new JointLimitMotor You normally won't have to call this. A JointLimitMotor-Field is already provided in the Joints able to have limits/motors.

Parameters:
defaultCFM -
defaultERP -
Method Detail

isDirty

public final boolean isDirty()

makeClean

public final void makeClean()

setVelocity

public final void setVelocity(float velocity)
powered joint : velocity

Parameters:
velocity -

getVelocity

public final float getVelocity()
Returns:
powered joint : velocity

setMaxForce

public final void setMaxForce(float maxForce)
powered joint : max force

Parameters:
maxForce -

getMaxForce

public final float getMaxForce()
Returns:
powered joint : max force

setLowStop

public final void setLowStop(float lowStop)
joint limit : lo stop (relative to initial)

Parameters:
lowStop -

getLowStop

public final float getLowStop()
Returns:
joint limit : lo stop (relative to initial)

setHighStop

public final void setHighStop(float hiStop)
joint limit : hi stop (relative to initial)

Parameters:
hiStop -

getHighStop

public final float getHighStop()
Returns:
joint limit : hi stop (relative to initial)

setFudgeFactor

public final void setFudgeFactor(float fudgeFactor)
when powering away from joint limits

Parameters:
fudgeFactor -

getFudgeFactor

public final float getFudgeFactor()
Returns:
when powering away from joint limits

setNormalCFM

public final void setNormalCFM(float normalCFM)
cfm to use when not at a stop

Parameters:
normalCFM -

getNormalCFM

public final float getNormalCFM()
Returns:
cfm to use when not at a stop

setStopERP

public final void setStopERP(float stopERP)
erp for when at joint limit

Parameters:
stopERP -

getStopERP

public final float getStopERP()
Returns:
erp for when at joint limit

setStopCFM

public final void setStopCFM(float stopCFM)
cfm for when at joint limit

Parameters:
stopCFM -

getStopCFM

public final float getStopCFM()
Returns:
cfm for when at joint limit

setBounce

public final void setBounce(float bounce)
restitution factor

Parameters:
bounce -

getBounce

public final float getBounce()
Returns:
restitution factor

setLimit

public final void setLimit(int limit)
variables used between getInfo1() and getInfo2() 0=free, 1=at lo limit, 2=at hi limit

Parameters:
limit -

getLimit

public final int getLimit()
variables used between getInfo1() and getInfo2() 0=free, 1=at lo limit, 2=at hi limit


setLimitError

public final void setLimitError(float limitErr)
if at limit, amount over limit

Parameters:
limitErr -

getLimitError

public final float getLimitError()
Returns:
if at limit, amount over limit