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 Details

    • logger

      public static final Logger logger
      message logger for this class
  • Constructor Details

    • SoftBodyMaterial

      protected SoftBodyMaterial()
      No-argument constructor needed by SavableClassUtil.
    • SoftBodyMaterial

      public SoftBodyMaterial(PhysicsSoftBody body)
      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

      public void cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
      Callback from Cloner 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 interface com.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

      public SoftBodyMaterial jmeClone()
      Create a shallow clone for the JME cloner.
      Specified by:
      jmeClone in interface com.jme3.util.clone.JmeCloneable
      Returns:
      a new instance
    • read

      public void read(com.jme3.export.JmeImporter importer) throws IOException
      De-serialize this material from the specified importer, for example when loading from a J3O file.
      Specified by:
      read in interface com.jme3.export.Savable
      Parameters:
      importer - (not null)
      Throws:
      IOException - from the importer
    • write

      public void write(com.jme3.export.JmeExporter exporter) throws IOException
      Serialize this material to the specified exporter, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Parameters:
      exporter - (not null)
      Throws:
      IOException - from the exporter