Package com.jme3.bullet.joints
Class SoftLinearJoint
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.PhysicsJoint
com.jme3.bullet.joints.SoftPhysicsJoint
com.jme3.bullet.joints.SoftLinearJoint
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
,Comparable<NativePhysicsObject>
A SoftPhysicsJoint based on Bullet's btSoftBody::LJoint.
-
Field Summary
Fields inherited from class com.jme3.bullet.joints.SoftPhysicsJoint
logger2
Fields inherited from class com.jme3.bullet.joints.PhysicsJoint
logger
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
ModifierConstructorDescriptionprotected
No-argument constructor needed by SavableClassUtil.SoftLinearJoint
(com.jme3.math.Vector3f location, PhysicsSoftBody softA, int clusterIndexA, PhysicsRigidBody rigidB) Instantiate a soft-rigid linear joint.SoftLinearJoint
(com.jme3.math.Vector3f location, PhysicsSoftBody softA, int clusterIndexA, PhysicsSoftBody softB, int clusterIndexB) Instantiate a soft-soft linear joint. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneFields
(com.jme3.util.clone.Cloner cloner, Object original) Callback fromCloner
to convert this shallow-cloned joint into a deep-cloned one, using the specified Cloner and original to resolve copied fields.com.jme3.math.Vector3f
copyLocation
(com.jme3.math.Vector3f storeResult) Copy the joint location.void
read
(com.jme3.export.JmeImporter importer) De-serialize this joint from the specified importer, for example when loading from a J3O file.void
setLocation
(com.jme3.math.Vector3f newLocation) Alter the joint location.void
write
(com.jme3.export.JmeExporter exporter) Serialize this joint to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.joints.SoftPhysicsJoint
checkParameters, clusterIndexA, clusterIndexB, finalizeNative, getCFM, getERP, getSoftBodyA, getSoftBodyB, getSplit, isEnabled, isSoftRigid, isSoftSoft, setCFM, setERP, setSplit
Methods inherited from class com.jme3.bullet.joints.PhysicsJoint
countEnds, destroy, findEnd, findOtherBody, getBody, getBodyA, getBodyB, getPhysicsSpace, jmeClone, setBodyA, setBodyB, setNativeId, setPhysicsSpace, toString
Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObject
-
Field Details
-
logger3
message logger for this class
-
-
Constructor Details
-
SoftLinearJoint
protected SoftLinearJoint()No-argument constructor needed by SavableClassUtil. -
SoftLinearJoint
public SoftLinearJoint(com.jme3.math.Vector3f location, PhysicsSoftBody softA, int clusterIndexA, PhysicsRigidBody rigidB) Instantiate a soft-rigid linear joint.- Parameters:
location
- the location of the joint (in physics-space coordinates, not null, unaffected)softA
- the soft body for the A end (not null, alias created)clusterIndexA
- the index of the cluster for the A end (≥0)rigidB
- the rigid body for the B end (not null, alias created)
-
SoftLinearJoint
public SoftLinearJoint(com.jme3.math.Vector3f location, PhysicsSoftBody softA, int clusterIndexA, PhysicsSoftBody softB, int clusterIndexB) Instantiate a soft-soft linear joint. Each soft body must contain a cluster.- Parameters:
location
- the location of the joint (in physics-space coordinates, not null, unaffected)softA
- the soft body for the A end (not null, alias created)clusterIndexA
- the index of the cluster for the A end (≥0)softB
- the soft body for the B end (not null, alias created)clusterIndexB
- the index of the cluster for the B end (≥0)
-
-
Method Details
-
copyLocation
public com.jme3.math.Vector3f copyLocation(com.jme3.math.Vector3f storeResult) Copy the joint location.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- the location (in physics-space coordinates, either storeResult or a new vector, not null)
-
setLocation
public void setLocation(com.jme3.math.Vector3f newLocation) Alter the joint location.- Parameters:
newLocation
- the desired location (in physics-space coordinates, not null, unaffected)
-
cloneFields
Callback fromCloner
to convert this shallow-cloned joint into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFields
in interfacecom.jme3.util.clone.JmeCloneable
- Overrides:
cloneFields
in classPhysicsJoint
- Parameters:
cloner
- the Cloner that's cloning this joint (not null)original
- the instance from which this joint was shallow-cloned (not null, unaffected)
-
read
De-serialize this joint from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfacecom.jme3.export.Savable
- Overrides:
read
in classSoftPhysicsJoint
- Parameters:
importer
- (not null)- Throws:
IOException
- from the importer
-
write
Serialize this joint to the specified exporter, for example when saving to a J3O file.- Specified by:
write
in interfacecom.jme3.export.Savable
- Overrides:
write
in classSoftPhysicsJoint
- Parameters:
exporter
- (not null)- Throws:
IOException
- from the exporter
-