|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jmex.physics.Joint
public abstract class Joint
A Joint constraints the relative location and rotation of two PhysicsNodes. By default a Joint does not allow to move any relative position or rotation change between the nodes. Axes can be added to allow movement in a specific direction or rotation around specific axes. Commonly a Joint can have only 6 axes. Some implementations may choose to allow 3 axes for positions plus 3 different axes for rotation but commonly translation and rotation axes will be equal. Commonly the axes should be perpendicular.
PhysicsSpace.createJoint()| Field Summary | |
|---|---|
static java.lang.String |
ACTIVE_PROPERTY
|
static java.lang.String |
ANCHOR_PROPERTY
|
static java.lang.String |
AXES_PROPERTY
|
static java.lang.String |
COLLISION_ENABLED_PROPERTY
|
static java.lang.String |
DAMPING_COEFFICIENT_PROPERTY
|
static java.lang.String |
NAME_PROPERTY
|
static java.lang.String |
NODES_PROPERTY
|
static java.lang.String |
SPRING_CONSTANT_PROPERTY
|
| Constructor Summary | |
|---|---|
protected |
Joint()
|
| Method Summary | |
|---|---|
protected void |
added(JointAxis axis)
|
abstract void |
attach(DynamicPhysicsNode node)
Attach this Joint to a single dynamic physics node. |
abstract void |
attach(DynamicPhysicsNode leftNode,
DynamicPhysicsNode rightNode)
Attach this Joint to two dynamic physics nodes. |
RotationalJointAxis |
createRotationalAxis()
|
protected abstract RotationalJointAxis |
createRotationalAxisImplementation()
|
TranslationalJointAxis |
createTranslationalAxis()
|
protected abstract TranslationalJointAxis |
createTranslationalAxisImplementation()
|
abstract void |
detach()
Detach this joint from all nodes. |
abstract com.jme.math.Vector3f |
getAnchor(com.jme.math.Vector3f store)
Query the anchor of this node. |
java.util.List<JointAxis> |
getAxes()
Get the list of axes to add/remove or query axes of this Joint. |
abstract float |
getBreakingLinearForce()
|
abstract float |
getBreakingTorque()
|
java.lang.Class |
getClassTag()
Returns the class tag. |
abstract float |
getDampingCoefficient()
Returns the value of the damping coefficient. |
java.lang.String |
getName()
getter for field name |
abstract java.util.List<? extends DynamicPhysicsNode> |
getNodes()
Query a list of nodes connected via this joint. |
abstract PhysicsSpace |
getSpace()
|
abstract float |
getSpringConstant()
Returns the value of the spring constant. |
boolean |
isActive()
|
abstract boolean |
isCollisionEnabled()
|
void |
read(com.jme.util.export.JMEImporter im)
|
void |
removed(JointAxis axis)
|
abstract void |
reset()
Reset the joint as if it has just been created. |
boolean |
setActive(boolean value)
Activate the node when added to a space. |
abstract void |
setAnchor(com.jme.math.Vector3f anchor)
Sets the anchor of this joint. |
abstract void |
setBreakingLinearForce(float breakingLinearForce)
Change the maximum allowed force that is applied by this joint in a single time step. |
abstract void |
setBreakingTorque(float breakingTorque)
Change the maximum allowed torque that is applied by this joint in a single time step. |
abstract void |
setCollisionEnabled(boolean enabled)
|
void |
setName(java.lang.String value)
setter for field name |
abstract void |
setSpring(float springConstant,
float dampingCoefficient)
Makes the joint 'softer' like a spring. |
void |
write(com.jme.util.export.JMEExporter ex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ACTIVE_PROPERTY
public static final java.lang.String ANCHOR_PROPERTY
public static final java.lang.String AXES_PROPERTY
public static final java.lang.String NAME_PROPERTY
public static final java.lang.String NODES_PROPERTY
public static final java.lang.String SPRING_CONSTANT_PROPERTY
public static final java.lang.String DAMPING_COEFFICIENT_PROPERTY
public static final java.lang.String COLLISION_ENABLED_PROPERTY
| Constructor Detail |
|---|
protected Joint()
| Method Detail |
|---|
protected void added(JointAxis axis)
public void removed(JointAxis axis)
public java.util.List<JointAxis> getAxes()
public TranslationalJointAxis createTranslationalAxis()
public RotationalJointAxis createRotationalAxis()
protected abstract TranslationalJointAxis createTranslationalAxisImplementation()
protected abstract RotationalJointAxis createRotationalAxisImplementation()
public abstract PhysicsSpace getSpace()
public final boolean isActive()
public boolean setActive(boolean value)
value - true when activated
public java.lang.String getName()
public void setName(java.lang.String value)
value - new value
public abstract void attach(DynamicPhysicsNode leftNode,
DynamicPhysicsNode rightNode)
leftNode - first node this joint is attached to, not nullrightNode - second node this joint is attached to, not nullattach(com.jmex.physics.DynamicPhysicsNode),
detach()public abstract void attach(DynamicPhysicsNode node)
node - the only node this joint is attached to, not nullattach(DynamicPhysicsNode, DynamicPhysicsNode),
detach()public abstract void detach()
attach(DynamicPhysicsNode, DynamicPhysicsNode),
attach(DynamicPhysicsNode)public abstract java.util.List<? extends DynamicPhysicsNode> getNodes()
attach(com.jmex.physics.DynamicPhysicsNode, com.jmex.physics.DynamicPhysicsNode) and detach() methods.
public abstract void reset()
public abstract void setAnchor(com.jme.math.Vector3f anchor)
anchor - new anchor pointpublic abstract com.jme.math.Vector3f getAnchor(com.jme.math.Vector3f store)
store - where to store the anchor (null to create a new vector)
public abstract void setSpring(float springConstant,
float dampingCoefficient)
springConstant - spring constantdampingCoefficient - damping coefficient
java.lang.UnsupportedOperationException - if not supported for the current axis configurationpublic abstract float getSpringConstant()
public abstract float getDampingCoefficient()
public java.lang.Class getClassTag()
getClassTag in interface com.jme.util.export.Savable
public void read(com.jme.util.export.JMEImporter im)
throws java.io.IOException
read in interface com.jme.util.export.Savablejava.io.IOException
public void write(com.jme.util.export.JMEExporter ex)
throws java.io.IOException
write in interface com.jme.util.export.Savablejava.io.IOExceptionpublic abstract float getBreakingLinearForce()
setBreakingLinearForce(float)public abstract void setBreakingLinearForce(float breakingLinearForce)
breakingLinearForce - new maximum forcepublic abstract float getBreakingTorque()
setBreakingTorque(float)public abstract void setBreakingTorque(float breakingTorque)
breakingTorque - new maximum torquepublic abstract void setCollisionEnabled(boolean enabled)
enabled - true to allow collision detection between joint bodies (default is false)public abstract boolean isCollisionEnabled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||