Class LinkConfig

java.lang.Object
com.jme3.bullet.animation.LinkConfig
All Implemented Interfaces:
com.jme3.export.Savable, Comparable<LinkConfig>

public class LinkConfig extends Object implements Comparable<LinkConfig>, com.jme3.export.Savable
Configuration data for a PhysicsLink, not including the bone name, attached model, or RangeOfMotion. Immutable except for read(com.jme3.export.JmeImporter).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiate a configuration for a link with mass=1, centered on the unweighted average of the vertex locations, shaped to the convex hull of the vertices.
    LinkConfig(float mass)
    Instantiate a configuration for a link with the specified mass, centered on the unweighted average of the vertex locations, shaped to the convex hull of the vertices.
    LinkConfig(float mass, LinkConfig oldConfig)
    Instantiate a configuration for a link with the specified mass, but with the centering and shaping of the specified configuration.
    LinkConfig(float massParm, MassHeuristic massH, ShapeHeuristic shapeH, com.jme3.math.Vector3f sScale, CenterHeuristic centerH)
    Instantiate a custom configuration with no RotationOrder.
    LinkConfig(float massParm, MassHeuristic massH, ShapeHeuristic shapeH, com.jme3.math.Vector3f sScale, CenterHeuristic centerH, RotationOrder axisOrder)
    Instantiate a custom configuration with a RotationOrder.
  • Method Summary

    Modifier and Type
    Method
    Description
    Read which centering heuristic to use.
    int
    Compare with another LinkConfig object.
    boolean
    equals(Object otherObject)
    Test for exact equivalence with another Object.
    int
    Generate the hash code for this LinkConfig.
    float
    Calculate the mass, if it can be determined from the configuration alone.
    Read which mass heuristic to use.
    float
    Read the parameter used to determine the mass.
    void
    read(com.jme3.export.JmeImporter importer)
    De-serialize this configuration from the specified importer, for example when loading from a J3O file.
    Read the order in which axis rotations will be applied.
    Read which shape heuristic to use.
    com.jme3.math.Vector3f
    shapeScale(com.jme3.math.Vector3f storeResult)
    Copy the scale factors used to adjust the size of the shape.
    void
    write(com.jme3.export.JmeExporter exporter)
    Serialize this configuration to the specified exporter, for example when saving to a J3O file.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

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

    • LinkConfig

      public LinkConfig()
      Instantiate a configuration for a link with mass=1, centered on the unweighted average of the vertex locations, shaped to the convex hull of the vertices.
    • LinkConfig

      public LinkConfig(float mass)
      Instantiate a configuration for a link with the specified mass, centered on the unweighted average of the vertex locations, shaped to the convex hull of the vertices.
      Parameters:
      mass - the desired mass (>0)
    • LinkConfig

      public LinkConfig(float mass, LinkConfig oldConfig)
      Instantiate a configuration for a link with the specified mass, but with the centering and shaping of the specified configuration.
      Parameters:
      mass - the desired mass (>0)
      oldConfig - (not null)
    • LinkConfig

      public LinkConfig(float massParm, MassHeuristic massH, ShapeHeuristic shapeH, com.jme3.math.Vector3f sScale, CenterHeuristic centerH)
      Instantiate a custom configuration with no RotationOrder.
      Parameters:
      massParm - parameter to use to determine the mass (>0)
      massH - which mass heuristic to use (not null)
      shapeH - which shaping heuristic to use (not null)
      sScale - used to adjust the size of the shape (not null, no negative component, unaffected)
      centerH - which centering heuristic to use (not null)
    • LinkConfig

      public LinkConfig(float massParm, MassHeuristic massH, ShapeHeuristic shapeH, com.jme3.math.Vector3f sScale, CenterHeuristic centerH, RotationOrder axisOrder)
      Instantiate a custom configuration with a RotationOrder.
      Parameters:
      massParm - parameter to use to determine the mass (>0)
      massH - which mass heuristic to use (not null)
      shapeH - which shaping heuristic to use (not null)
      sScale - used to adjust the size of the shape (not null, no negative component, unaffected)
      centerH - which centering heuristic to use (not null)
      axisOrder - the rotation order for New6Dof axes, or null for a SixDofJoint
  • Method Details

    • centerHeuristic

      public CenterHeuristic centerHeuristic()
      Read which centering heuristic to use.
      Returns:
      the enum value (not null)
    • mass

      public float mass()
      Calculate the mass, if it can be determined from the configuration alone.
      Returns:
      the mass (in physics units, >0) or NaN if undetermined
    • massHeuristic

      public MassHeuristic massHeuristic()
      Read which mass heuristic to use.
      Returns:
      the enum value (not null)
    • massParameter

      public float massParameter()
      Read the parameter used to determine the mass.
      Returns:
      the parameter value (>0)
    • rotationOrder

      public RotationOrder rotationOrder()
      Read the order in which axis rotations will be applied.
      Returns:
      the enum value or null
    • shapeHeuristic

      public ShapeHeuristic shapeHeuristic()
      Read which shape heuristic to use.
      Returns:
      the enum value (not null)
    • shapeScale

      public com.jme3.math.Vector3f shapeScale(com.jme3.math.Vector3f storeResult)
      Copy the scale factors used to adjust the size of the shape.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the scale factor for each axis (either storeResult or a new instance)
    • compareTo

      public int compareTo(LinkConfig other)
      Compare with another LinkConfig object.
      Specified by:
      compareTo in interface Comparable<LinkConfig>
      Parameters:
      other - (not null, unaffected)
      Returns:
      0 if the objects are equivalent; negative if this comes before other; positive if this comes after other
    • read

      public void read(com.jme3.export.JmeImporter importer) throws IOException
      De-serialize this configuration from the specified importer, for example when loading from a J3O file.
      Specified by:
      read in interface com.jme3.export.Savable
      Parameters:
      importer - (not null)
      Throws:
      IOException - from the importer
    • write

      public void write(com.jme3.export.JmeExporter exporter) throws IOException
      Serialize this configuration to the specified exporter, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Parameters:
      exporter - (not null)
      Throws:
      IOException - from the exporter
    • equals

      public boolean equals(Object otherObject)
      Test for exact equivalence with another Object.
      Overrides:
      equals in class Object
      Parameters:
      otherObject - the object to compare to (may be null, unaffected)
      Returns:
      true if the objects are equivalent, otherwise false
    • hashCode

      public int hashCode()
      Generate the hash code for this LinkConfig.
      Overrides:
      hashCode in class Object
      Returns:
      value for use in hashing