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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNo-argument constructor needed by SavableClassUtil.Instantiate a config with the default properties. -
Method Summary
Modifier and TypeMethodDescriptionReturn the aerodynamics model.voidcloneFields(com.jme3.util.clone.Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned config into a deep-cloned one, using the specified Cloner and original to resolve copied fields.intReturn the number of cluster-solver iterations (native field: citerations).intReturn the collisions flags (native field: collisions).voidcopyAll(SoftBodyConfig source) Copy all parameter values from the specified config.intReturn the number of drift-solver iterations (native field: diterations).floatReturn the value of the specified parameter.jmeClone()Create a shallow clone for the JME cloner.intReturn the number of position-solver iterations (native field: piterations).voidread(com.jme3.export.JmeImporter importer) De-serialize this config from the specified importer, for example when loading from a J3O file.voidAlter the specified parameter.voidsetAerodynamics(Aero model) Alter the aerodynamics model.voidsetClusterIterations(int numIterations) Alter the number of cluster-solver iterations (native field: citerations).voidsetCollisionFlags(int flag, int... additionalFlags) Alter the collision flags (default=SDF_RS).voidsetDriftIterations(int numIterations) Alter the number of drift-solver iterations (native field: diterations).voidsetPositionIterations(int numIterations) Alter the number of position-solver iterations (native field: piterations).voidsetVelocityIterations(int numIterations) Alter the number of velocity-solver iterations (native field: viterations).intReturn the number of velocity-solver iterations (native field: viterations).voidwrite(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 fromClonerto convert this shallow-cloned config 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 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:
jmeClonein 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:
readin 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:
writein interfacecom.jme3.export.Savable- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-