public class HingeJoint extends PhysicsJoint
Modifier and Type | Field and Description |
---|---|
protected boolean |
angularOnly |
protected Vector3f |
axisA |
protected Vector3f |
axisB |
protected float |
biasFactor |
protected float |
limitSoftness |
protected float |
relaxationFactor |
collisionBetweenLinkedBodys, constraint, nodeA, nodeB, pivotA, pivotB
Modifier | Constructor and Description |
---|---|
protected |
HingeJoint() |
|
HingeJoint(PhysicsRigidBody nodeA,
PhysicsRigidBody nodeB,
Vector3f pivotA,
Vector3f pivotB,
Vector3f axisA,
Vector3f axisB)
Creates a new HingeJoint
|
Modifier and Type | Method and Description |
---|---|
protected void |
createJoint() |
void |
enableMotor(boolean enable,
float targetVelocity,
float maxMotorImpulse)
Enables the motor.
|
float |
getHingeAngle() |
float |
getLowerLimit() |
float |
getUpperLimit() |
void |
read(JmeImporter im) |
void |
setAngularOnly(boolean angularOnly) |
void |
setLimit(float low,
float high)
Sets the limits of this joint.
|
void |
setLimit(float low,
float high,
float _softness,
float _biasFactor,
float _relaxationFactor)
Sets the limits of this joint.
|
void |
write(JmeExporter ex) |
destroy, getAppliedImpulse, getBodyA, getBodyB, getObjectId, getPivotA, getPivotB, isCollisionBetweenLinkedBodys, setCollisionBetweenLinkedBodys
protected Vector3f axisA
protected Vector3f axisB
protected boolean angularOnly
protected float biasFactor
protected float relaxationFactor
protected float limitSoftness
protected HingeJoint()
public HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB)
nodeA
- the body for the A end (not null, alias created)nodeB
- the body for the B end (not null, alias created)pivotA
- local translation of the joint connection point in node ApivotB
- local translation of the joint connection point in node BaxisA
- the joint axis in A's local coordinates (unit vector,
alias created)axisB
- the joint axis in B's local coordinates (unit vector,
alias created)public void enableMotor(boolean enable, float targetVelocity, float maxMotorImpulse)
enable
- if true, motor is enabled.targetVelocity
- the target velocity of the rotation.maxMotorImpulse
- the max force applied to the hinge to rotate it.public void setLimit(float low, float high)
low
- the low limit in radians.high
- the high limit in radians.public void setLimit(float low, float high, float _softness, float _biasFactor, float _relaxationFactor)
low
- the low limit in radians.high
- the high limit in radians._softness
- the factor at which the velocity error correction starts operating,i.e a softness of 0.9 means that the vel. corr starts at 90% of the limit range._biasFactor
- the magnitude of the position correction. It tells you how strictly the position error (drift ) is corrected._relaxationFactor
- the rate at which velocity errors are corrected. This can be seen as the strength of the limits. A low value will make the limits more spongy.public float getUpperLimit()
public float getLowerLimit()
public void setAngularOnly(boolean angularOnly)
public float getHingeAngle()
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class PhysicsJoint
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class PhysicsJoint
java.io.IOException
protected void createJoint()