public abstract class PhysicsJoint extends java.lang.Object implements 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 Vector3f |
pivotA
local offset of this joint's connection point in node A
|
protected 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,
Vector3f pivotA,
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.
|
Vector3f |
getPivotA()
Access the local offset of the joint connection point in node A.
|
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(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(JmeExporter ex)
Serialize this joint, for example when saving to a J3O file.
|
protected long objectId
protected PhysicsRigidBody nodeA
protected PhysicsRigidBody nodeB
protected Vector3f pivotA
protected Vector3f pivotB
protected boolean collisionBetweenLinkedBodys
protected PhysicsJoint()
public PhysicsJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, 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 Vector3f getPivotA()
public Vector3f getPivotB()
public void destroy()
public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- ignored by the garbage collector