Package com.jme3.bullet.objects.infos
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
-
Constructor Summary
ModifierConstructorDescriptionprotected
No-argument constructor needed by SavableClassUtil.Instantiate a config with the default properties. -
Method Summary
Modifier and TypeMethodDescriptionReturn the aerodynamics model.void
cloneFields
(com.jme3.util.clone.Cloner cloner, Object original) Callback fromCloner
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
copyAll
(SoftBodyConfig source) Copy all parameter values from the specified config.int
Return the number of drift-solver iterations (native field: diterations).float
Return the value of the specified parameter.jmeClone()
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
Alter the specified parameter.void
setAerodynamics
(Aero model) 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.
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
SoftBodyConfig
protected SoftBodyConfig()No-argument constructor needed by SavableClassUtil. -
SoftBodyConfig
Instantiate a config with the default properties.- Parameters:
body
- the corresponding soft body (not null)
-
-
Method Details
-
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 inConfigFlag
.- Returns:
- the flags that are set, ORed together
-
copyAll
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
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
Alter the specified parameter.- Parameters:
parameter
- which parameter to set (not null)desiredValue
- the desired parameter value
-
setAerodynamics
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 inConfigFlag
.- Parameters:
flag
- the first flag to set, or 0x0 to clear all flagsadditionalFlags
- ... 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
Callback fromCloner
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 interfacecom.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
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 config 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 config 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
-