public abstract class PhysicsJoint
extends java.lang.Object
implements com.jme3.export.Savable
Joints include ConeJoint, HingeJoint, Point2PointJoint, and SixDofJoint.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
collisionBetweenLinkedBodys |
protected PhysicsRigidBody |
nodeA
one of the connected rigid bodies
|
protected PhysicsRigidBody |
nodeB
the other connected rigid body
|
protected long |
objectId
Unique identifier of the Bullet constraint.
|
protected com.jme3.math.Vector3f |
pivotA
local offset of this joint's connection point in node A
|
protected com.jme3.math.Vector3f |
pivotB
local offset of this joint's connection point in node B
|
| Modifier | Constructor and Description |
|---|---|
protected |
PhysicsJoint()
No-argument constructor needed by SavableClassUtil.
|
|
PhysicsJoint(PhysicsRigidBody nodeA,
PhysicsRigidBody nodeB,
com.jme3.math.Vector3f pivotA,
com.jme3.math.Vector3f pivotB)
Instantiate a PhysicsJoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this joint and remove it from the joint lists of its connected
bodies.
|
protected void |
finalize()
Finalize this physics joint just before it is destroyed.
|
float |
getAppliedImpulse()
Read the magnitude of the applied impulse.
|
PhysicsRigidBody |
getBodyA()
Access the 1st body specified in during construction.
|
PhysicsRigidBody |
getBodyB()
Access the 2nd body specified in during construction.
|
long |
getObjectId()
Read the id of the Bullet constraint.
|
com.jme3.math.Vector3f |
getPivotA()
Access the local offset of the joint connection point in node A.
|
com.jme3.math.Vector3f |
getPivotB()
Access the local offset of the joint connection point in node A.
|
boolean |
isCollisionBetweenLinkedBodys()
Test whether collisions are allowed between the linked bodies.
|
void |
read(com.jme3.export.JmeImporter im)
De-serialize this joint, for example when loading from a J3O file.
|
void |
setCollisionBetweenLinkedBodys(boolean collisionBetweenLinkedBodys)
Enable or disable collisions between the linked bodies.
|
void |
write(com.jme3.export.JmeExporter ex)
Serialize this joint, for example when saving to a J3O file.
|
protected long objectId
protected PhysicsRigidBody nodeA
protected PhysicsRigidBody nodeB
protected com.jme3.math.Vector3f pivotA
protected com.jme3.math.Vector3f pivotB
protected boolean collisionBetweenLinkedBodys
protected PhysicsJoint()
public PhysicsJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, com.jme3.math.Vector3f pivotA, com.jme3.math.Vector3f pivotB)
nodeA - the 1st body connected by the joint (not null, alias
created)nodeB - the 2nd body connected by the joint (not null, alias
created)pivotA - local offset of the joint connection point in node A (not
null, alias created)pivotB - local offset of the joint connection point in node B (not
null, alias created)public float getAppliedImpulse()
public long getObjectId()
public boolean isCollisionBetweenLinkedBodys()
public void setCollisionBetweenLinkedBodys(boolean collisionBetweenLinkedBodys)
collisionBetweenLinkedBodys - true → allow collisions, false → prevent thempublic PhysicsRigidBody getBodyA()
public PhysicsRigidBody getBodyB()
public com.jme3.math.Vector3f getPivotA()
public com.jme3.math.Vector3f getPivotB()
public void destroy()
public void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savableex - exporter (not null)java.io.IOException - from exporterpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savableim - importer (not null)java.io.IOException - from importerprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - ignored by the garbage collector