Package com.jme3.bullet.objects.infos
Class SoftBodyMaterial
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.objects.infos.SoftBodyMaterial
- All Implemented Interfaces:
com.jme3.export.Savable,com.jme3.util.clone.JmeCloneable,Cloneable,Comparable<NativePhysicsObject>
public class SoftBodyMaterial
extends NativePhysicsObject
implements com.jme3.util.clone.JmeCloneable, com.jme3.export.Savable
Provide access to 3 fields of the native btSoftBody::Material struct.
-
Field Summary
FieldsFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNo-argument constructor needed by SavableClassUtil.Instantiate a material with the default properties. -
Method Summary
Modifier and TypeMethodDescriptionfloatRead the angular-stiffness coefficient (native field: m_kAST).voidcloneFields(com.jme3.util.clone.Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned material into a deep-cloned one, using the specified Cloner and original to resolve copied fields.jmeClone()Create a shallow clone for the JME cloner.floatRead the linear-stiffness coefficient (native field: m_kLST).voidread(com.jme3.export.JmeImporter importer) De-serialize this material from the specified importer, for example when loading from a J3O file.voidsetAngularStiffness(float coefficient) Alter the angular-stiffness coefficient (native field: m_kAST).voidsetLinearStiffness(float coefficient) Alter the linear-stiffness coefficient (native field: m_kLST).voidsetVolumeStiffness(float coefficient) Alter the volume-stiffness coefficient (native field: m_kVST).floatRead the volume-stiffness coefficient (native field: m_kVST).voidwrite(com.jme3.export.JmeExporter exporter) Serialize this material to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObject
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
SoftBodyMaterial
protected SoftBodyMaterial()No-argument constructor needed by SavableClassUtil. -
SoftBodyMaterial
Instantiate a material with the default properties.- Parameters:
body- the body to which this material will apply (not null)
-
-
Method Details
-
angularStiffness
public float angularStiffness()Read the angular-stiffness coefficient (native field: m_kAST).- Returns:
- the coefficient (≥0, ≤1)
-
linearStiffness
public float linearStiffness()Read the linear-stiffness coefficient (native field: m_kLST).- Returns:
- the coefficient (≥0, ≤1)
-
setAngularStiffness
public void setAngularStiffness(float coefficient) Alter the angular-stiffness coefficient (native field: m_kAST).- Parameters:
coefficient- the desired coefficient (≥0, ≤1, default=1)
-
setLinearStiffness
public void setLinearStiffness(float coefficient) Alter the linear-stiffness coefficient (native field: m_kLST).- Parameters:
coefficient- the desired coefficient (≥0, ≤1, default=1)
-
setVolumeStiffness
public void setVolumeStiffness(float coefficient) Alter the volume-stiffness coefficient (native field: m_kVST).- Parameters:
coefficient- the desired coefficient (≥0, ≤1, default=1)
-
volumeStiffness
public float volumeStiffness()Read the volume-stiffness coefficient (native field: m_kVST).- Returns:
- the coefficient (≥0, ≤1)
-
cloneFields
Callback fromClonerto convert this shallow-cloned material into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFieldsin interfacecom.jme3.util.clone.JmeCloneable- Parameters:
cloner- the Cloner that's cloning this material (not null)original- the instance from which this material was shallow-cloned (not null, unaffected)
-
jmeClone
Create a shallow clone for the JME cloner.- Specified by:
jmeClonein interfacecom.jme3.util.clone.JmeCloneable- Returns:
- a new instance
-
read
De-serialize this material from the specified importer, for example when loading from a J3O file.- Specified by:
readin interfacecom.jme3.export.Savable- Parameters:
importer- (not null)- Throws:
IOException- from the importer
-
write
Serialize this material to the specified exporter, for example when saving to a J3O file.- Specified by:
writein interfacecom.jme3.export.Savable- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-