Class ReducedDeformableBody

All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class ReducedDeformableBody extends PhysicsSoftBody
A simplified soft body embedded in a rigid frame, based on Bullet's btReducedDeformableBody.
  • Field Details

    • logger3

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

    • ReducedDeformableBody

      public ReducedDeformableBody(Vector3f[] locations, float[] masses)
      Instantiate a deformable body with the specified nodes. The new body is not added to any physics space.
      Parameters:
      locations - the initial node locations (not null, alias created)
      masses - the initial node masses (not null, each ≥0, alias created)
  • Method Details

    • getLinearVelocity

      public Vector3f getLinearVelocity(Vector3f storeResult)
      Copy the rigid velocity.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      a velocity vector (physics-space units per second in physics-space coordinates, either storeResult or a new vector)
    • isReducedModesEnabled

      public boolean isReducedModesEnabled()
      Test whether reduced modes are enabled.
      Returns:
      true if enabled, false if rigid-only
    • pinNode

      public void pinNode(int nodeIndex)
      Pin a node.
      Parameters:
      nodeIndex - the index of the node (≥0)
    • setDamping

      public void setDamping(float alpha, float beta)
      Alter the Rayleigh damping parameters.
      Parameters:
      alpha - the desired alpha value (default=0)
      beta - the desired beta value (default=0)
    • setLinearVelocity

      public void setLinearVelocity(Vector3f velocity)
      Alter the rigid velocity.
      Parameters:
      velocity - the desired value (not null, unaffected)
    • setReducedModes

      public void setReducedModes(int numReduced, int numFull)
      Alter the number of modes.
      Parameters:
      numReduced - the number of reduced modes (default=0)
      numFull - the number of full modes (default=0)
    • setReducedModesEnabled

      public void setReducedModesEnabled(boolean enable)
      Enable/disable reduced modes.
      Parameters:
      enable - true to enabled reduced modes, false for rigid-only (default=true)
    • setStiffnessScale

      public void setStiffnessScale(float scale)
      Alter the stiffness scale.
      Parameters:
      scale - the desired scale (default=1)
    • newEmptySoftBody

      protected void newEmptySoftBody()
      Create an empty btReducedDeformableBody for this ReducedDeformableBody, using the pre-existing worldInfo. The pre-existing btReducedDeformableBody (if any) will be destroyed.
      Overrides:
      newEmptySoftBody in class PhysicsSoftBody