public abstract class PhysicsLink extends java.lang.Object implements JmeCloneable, Savable
This class is shared between JBullet and Native Bullet.
Modifier and Type | Field and Description |
---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
Modifier | Constructor and Description |
---|---|
protected |
PhysicsLink()
No-argument constructor needed by SavableClassUtil.
|
Modifier and Type | Method and Description |
---|---|
protected void |
blendToKinematicMode(float blendInterval)
Begin blending this link to a purely kinematic mode.
|
java.lang.String |
boneName()
Read the name of the corresponding bone.
|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Callback from
Cloner to convert this
shallow-cloned link into a deep-cloned one, using the specified cloner
and original to resolve copied fields. |
int |
countChildren()
Count this link's immediate children in the link hierarchy.
|
protected abstract void |
dynamicUpdate()
Update this link in Dynamic mode, setting the linked bone's transform
based on the transform of the rigid body.
|
Joint |
getBone()
Access the corresponding bone.
|
DacLinks |
getControl()
Access the control that manages this link.
|
PhysicsJoint |
getJoint()
Access the joint between this link's rigid body and that of its parent.
|
PhysicsLink |
getParent()
Access this link's parent/manager in the link hierarchy.
|
PhysicsRigidBody |
getRigidBody()
Access the linked rigid body.
|
boolean |
isKinematic()
Test whether the link is in kinematic mode.
|
PhysicsLink |
jmeClone()
Create a shallow clone for the JME cloner.
|
protected void |
kinematicUpdate(float tpf)
Update this link in blended Kinematic mode.
|
float |
kinematicWeight()
Read the kinematic weight of this link.
|
PhysicsLink[] |
listChildren()
Enumerate this link's immediate children in the link hierarchy.
|
protected Vector3f |
localOffset(Vector3f storeResult)
Copy the local offset of this link.
|
abstract java.lang.String |
name()
Unambiguously identify this link by name, within its DynamicAnimControl.
|
Transform |
physicsTransform(Transform storeResult)
Calculate a physics transform for the rigid body (to match the skeleton
bone).
|
void |
read(JmeImporter im)
De-serialize this link, for example when loading from a J3O file.
|
void |
setDynamic(Vector3f uniformAcceleration)
Immediately put this link into dynamic mode.
|
protected void |
setJoint(PhysicsJoint joint)
Assign a physics joint to this link, or cancel the assigned joint.
|
protected void |
setParent(PhysicsLink parent)
Assign a parent/manager for this link.
|
protected void |
setRigidBody(PhysicsRigidBody body)
Alter the rigid body for this link.
|
void |
write(JmeExporter ex)
Serialize this link, for example when saving to a J3O file.
|
public static final java.util.logging.Logger logger
protected PhysicsLink()
public java.lang.String boneName()
public int countChildren()
public final Joint getBone()
public DacLinks getControl()
public PhysicsJoint getJoint()
public PhysicsLink getParent()
public PhysicsRigidBody getRigidBody()
public boolean isKinematic()
public float kinematicWeight()
public PhysicsLink[] listChildren()
public abstract java.lang.String name()
public Transform physicsTransform(Transform storeResult)
storeResult
- storage for the result (modified if not null)public void setDynamic(Vector3f uniformAcceleration)
uniformAcceleration
- the uniform acceleration vector to apply (in
physics-space coordinates, not null, unaffected)protected void blendToKinematicMode(float blendInterval)
blendInterval
- the duration of the blend interval (in seconds,
≥0)protected abstract void dynamicUpdate()
protected void kinematicUpdate(float tpf)
tpf
- the time interval between frames (in seconds, ≥0)protected Vector3f localOffset(Vector3f storeResult)
storeResult
- storage for the result (modified if not null)protected final void setJoint(PhysicsJoint joint)
joint
- (may be null, alias created)protected final void setParent(PhysicsLink parent)
parent
- (not null, alias created)protected void setRigidBody(PhysicsRigidBody body)
body
- the desired rigid body (not null, alias created)public void cloneFields(Cloner cloner, java.lang.Object original)
Cloner
to convert this
shallow-cloned link into a deep-cloned one, using the specified cloner
and original to resolve copied fields.cloneFields
in interface JmeCloneable
cloner
- the cloner that's cloning this link (not null)original
- the instance from which this link was shallow-cloned
(unused)public PhysicsLink jmeClone()
jmeClone
in interface JmeCloneable
public void read(JmeImporter im) throws java.io.IOException
public void write(JmeExporter ex) throws java.io.IOException