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
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
ModifierConstructorDescriptionprotected
No-argument constructor needed by SavableClassUtil.Instantiate a material with the default properties. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Read the angular-stiffness coefficient (native field: m_kAST).void
cloneFields
(com.jme3.util.clone.Cloner cloner, Object original) Callback fromCloner
to 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.float
Read the linear-stiffness coefficient (native field: m_kLST).void
read
(com.jme3.export.JmeImporter importer) De-serialize this material from the specified importer, for example when loading from a J3O file.void
setAngularStiffness
(float coefficient) Alter the angular-stiffness coefficient (native field: m_kAST).void
setLinearStiffness
(float coefficient) Alter the linear-stiffness coefficient (native field: m_kLST).void
setVolumeStiffness
(float coefficient) Alter the volume-stiffness coefficient (native field: m_kVST).float
Read the volume-stiffness coefficient (native field: m_kVST).void
write
(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 fromCloner
to convert this shallow-cloned material into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFields
in 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:
jmeClone
in 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:
read
in 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:
write
in interfacecom.jme3.export.Savable
- Parameters:
exporter
- (not null)- Throws:
IOException
- from the exporter
-