Class SoftBodyConfig

java.lang.Object
com.jme3.bullet.objects.infos.SoftBodyConfig
All Implemented Interfaces:
com.jme3.export.Savable, com.jme3.util.clone.JmeCloneable, Cloneable

public class SoftBodyConfig extends Object implements com.jme3.util.clone.JmeCloneable, com.jme3.export.Savable
Provide access to fields of the native btSoftBody::Config struct. Soft bodies are one-to-one with config instances.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    No-argument constructor needed by SavableClassUtil.
     
    Instantiate a config with the default properties.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the aerodynamics model.
    void
    cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
    Callback from Cloner to convert this shallow-cloned config into a deep-cloned one, using the specified Cloner and original to resolve copied fields.
    int
    Return the number of cluster-solver iterations (native field: citerations).
    int
    Return the collisions flags (native field: collisions).
    void
    Copy all parameter values from the specified config.
    int
    Return the number of drift-solver iterations (native field: diterations).
    float
    get(Sbcp parameter)
    Return the value of the specified parameter.
    Create a shallow clone for the JME cloner.
    int
    Return the number of position-solver iterations (native field: piterations).
    void
    read(com.jme3.export.JmeImporter importer)
    De-serialize this config from the specified importer, for example when loading from a J3O file.
    void
    set(Sbcp parameter, float desiredValue)
    Alter the specified parameter.
    void
    Alter the aerodynamics model.
    void
    setClusterIterations(int numIterations)
    Alter the number of cluster-solver iterations (native field: citerations).
    void
    setCollisionFlags(int flag, int... additionalFlags)
    Alter the collision flags (default=SDF_RS).
    void
    setDriftIterations(int numIterations)
    Alter the number of drift-solver iterations (native field: diterations).
    void
    setPositionIterations(int numIterations)
    Alter the number of position-solver iterations (native field: piterations).
    void
    setVelocityIterations(int numIterations)
    Alter the number of velocity-solver iterations (native field: viterations).
    int
    Return the number of velocity-solver iterations (native field: viterations).
    void
    write(com.jme3.export.JmeExporter exporter)
    Serialize this config to the specified exporter, for example when saving to a J3O file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

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

    • SoftBodyConfig

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

      public SoftBodyConfig(PhysicsSoftBody body)
      Instantiate a config with the default properties.
      Parameters:
      body - the corresponding soft body (not null)
  • Method Details

    • aerodynamics

      public Aero aerodynamics()
      Return the aerodynamics model.
      Returns:
      an enum value (not null)
    • clusterIterations

      public int clusterIterations()
      Return the number of cluster-solver iterations (native field: citerations).
      Returns:
      the iteration count (≥0)
    • collisionFlags

      public int collisionFlags()
      Return the collisions flags (native field: collisions). Flags are defined in ConfigFlag.
      Returns:
      the flags that are set, ORed together
    • copyAll

      public void copyAll(SoftBodyConfig source)
      Copy all parameter values from the specified config.
      Parameters:
      source - the config to copy from (not null, unaffected)
    • driftIterations

      public int driftIterations()
      Return the number of drift-solver iterations (native field: diterations).
      Returns:
      the iteration count (≥0)
    • get

      public float get(Sbcp parameter)
      Return the value of the specified parameter.
      Parameters:
      parameter - which parameter to read (not null)
      Returns:
      the parameter value
    • positionIterations

      public int positionIterations()
      Return the number of position-solver iterations (native field: piterations).
      Returns:
      the iteration count (≥0)
    • set

      public void set(Sbcp parameter, float desiredValue)
      Alter the specified parameter.
      Parameters:
      parameter - which parameter to set (not null)
      desiredValue - the desired parameter value
    • setAerodynamics

      public void setAerodynamics(Aero model)
      Alter the aerodynamics model.
      Parameters:
      model - the desired aerodynamics model (not null, default=V_Point)
    • setClusterIterations

      public void setClusterIterations(int numIterations)
      Alter the number of cluster-solver iterations (native field: citerations).
      Parameters:
      numIterations - the desired number of iterations (≥0, default=4)
    • setCollisionFlags

      public void setCollisionFlags(int flag, int... additionalFlags)
      Alter the collision flags (default=SDF_RS). Flag values are defined in ConfigFlag.
      Parameters:
      flag - the first flag to set, or 0x0 to clear all flags
      additionalFlags - ... additional flags to set. Flags are ORed together.
    • setDriftIterations

      public void setDriftIterations(int numIterations)
      Alter the number of drift-solver iterations (native field: diterations).
      Parameters:
      numIterations - the desired number of iterations (≥0, default=0)
    • setPositionIterations

      public void setPositionIterations(int numIterations)
      Alter the number of position-solver iterations (native field: piterations).
      Parameters:
      numIterations - the desired number of iterations (≥0, default=1)
    • setVelocityIterations

      public void setVelocityIterations(int numIterations)
      Alter the number of velocity-solver iterations (native field: viterations).
      Parameters:
      numIterations - the desired number of iterations (≥0, default=0)
    • velocityIterations

      public int velocityIterations()
      Return the number of velocity-solver iterations (native field: viterations).
      Returns:
      the iteration count (≥0)
    • cloneFields

      public void cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
      Callback from Cloner to convert this shallow-cloned config 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 config (not null)
      original - the instance from which this config was shallow-cloned (not null, unaffected)
    • jmeClone

      public SoftBodyConfig 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 config 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 config 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