Class SoftBodyWorldInfo

java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.SoftBodyWorldInfo
All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class SoftBodyWorldInfo extends 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 Details

    • logger

      public static final Logger 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

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

      public Vector3f copyGravity(Vector3f storeResult)
      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

      public Vector3f copyWaterNormal(Vector3f storeResult)
      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

      public void setGravity(Vector3f acceleration)
      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

      public void setWaterNormal(Vector3f normalDirection)
      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)