Package com.jme3.bullet
Class SoftBodyWorldInfo
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.SoftBodyWorldInfo
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
Physics-simulation parameters that can be customized for each
PhysicsSoftBody, based on Bullet's
btSoftBodyWorldInfo
.
NOTE: When a PhysicsSoftBody is added to a PhysicsSoftSpace, it acquires the SoftBodyWorldInfo of that space. To customize a body, assign it a new info after adding it to the space.
-
Field Summary
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
ConstructorDescriptionInstantiate an info that refers to a new btSoftBodyWorldInfo with the default parameters.SoftBodyWorldInfo
(long nativeId) Instantiate an info that refers to the identified native object. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the air density.void
copyAll
(SoftBodyWorldInfo source) Copy all parameter values from the specified info.copyGravity
(Vector3f storeResult) Copy the gravitational acceleration.copyWaterNormal
(Vector3f storeResult) Copy the normal direction of the water surface.float
Return the maximum distance a node can travel in a simulation step.void
setAirDensity
(float density) Alter the air density.void
setGravity
(Vector3f acceleration) Alter the gravitational acceleration.void
setMaxDisplacement
(float maxDisplacement) Alter the maximum distance a node can travel per simulation step.void
setWaterDensity
(float density) Alter the water density.void
setWaterNormal
(Vector3f normalDirection) Alter the water normal.void
setWaterOffset
(float offset) Alter the water offset.float
Return the water density.float
Return the water offset.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
-
SoftBodyWorldInfo
public SoftBodyWorldInfo()Instantiate an info that refers to a new btSoftBodyWorldInfo with the default parameters. -
SoftBodyWorldInfo
public SoftBodyWorldInfo(long nativeId) Instantiate an info that refers to the identified native object. Used internally.- Parameters:
nativeId
- the ID of a pre-existing btSoftBodyWorldInfo (not zero)
-
-
Method Details
-
airDensity
public float airDensity()Return the air density.- Returns:
- the density
-
copyAll
Copy all parameter values from the specified info.- Parameters:
source
- the info to copy from (not null, unaffected)
-
copyGravity
Copy the gravitational acceleration.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- an acceleration vector in physics-space coordinates (either storeResult or a new vector, not null)
-
copyWaterNormal
Copy the normal direction of the water surface.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- a direction vector (in physics-space coordinates, either storeResult or a new vector, not null)
-
maxDisplacement
public float maxDisplacement()Return the maximum distance a node can travel in a simulation step.- Returns:
- the distance (in physics-space units)
-
setAirDensity
public void setAirDensity(float density) Alter the air density.- Parameters:
density
- the desired density (default=1.2)
-
setGravity
Alter the gravitational acceleration.- Parameters:
acceleration
- the desired acceleration vector (in physics-space coordinates, not null, unaffected, default=(0,-10,0))
-
setMaxDisplacement
public void setMaxDisplacement(float maxDisplacement) Alter the maximum distance a node can travel per simulation step.- Parameters:
maxDisplacement
- the desired value (>0, default=1000)
-
setWaterDensity
public void setWaterDensity(float density) Alter the water density.- Parameters:
density
- the desired density (default=0)
-
setWaterNormal
Alter the water normal.- Parameters:
normalDirection
- the desired normal direction (not null, unaffected, default=(0,0,0))
-
setWaterOffset
public void setWaterOffset(float offset) Alter the water offset.- Parameters:
offset
- the desired offset distance (in physics-space units, default=0)
-
waterDensity
public float waterDensity()Return the water density.- Returns:
- the density
-
waterOffset
public float waterOffset()Return the water offset.- Returns:
- the offset distance (in physics-space units)
-