Class RangeOfMotion

java.lang.Object
com.jme3.bullet.animation.RangeOfMotion
All Implemented Interfaces:
Savable

public class RangeOfMotion extends Object implements Savable
Range of motion for a ragdoll joint. Immutable except for read(com.jme3.export.JmeImporter).

This class is shared between JBullet and Native Bullet.

  • Field Summary

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

    Constructors
    Constructor
    Description
    Instantiate a preset with no motion allowed.
    RangeOfMotion(float maxAngle)
    Instantiate a preset with the specified symmetric range of motion.
    RangeOfMotion(float maxX, float maxY, float maxZ)
    Instantiate a preset with the specified symmetric range of motion.
    RangeOfMotion(float maxX, float minX, float maxY, float minY, float maxZ, float minZ)
    Instantiate a preset with the specified range of motion.
    RangeOfMotion(int axisIndex)
    Instantiate a preset for rotation on a single axis.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    getMaxRotation(int axisIndex)
    Read the maximum rotation around the indexed axis.
    float
    getMinRotation(int axisIndex)
    Read the minimum rotation around the indexed axis.
    void
    De-serialize this preset, for example when loading from a J3O file.
    void
    Apply this preset to the specified joint.
    void
    Serialize this preset, for example when saving to a J3O file.

    Methods inherited from class java.lang.Object

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

    • logger

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

    • RangeOfMotion

      public RangeOfMotion()
      Instantiate a preset with no motion allowed.
    • RangeOfMotion

      public RangeOfMotion(float maxX, float minX, float maxY, float minY, float maxZ, float minZ)
      Instantiate a preset with the specified range of motion.
      Parameters:
      maxX - the maximum rotation around the X axis (in radians)
      minX - the minimum rotation around the X axis (in radians)
      maxY - the maximum rotation around the Y axis (in radians)
      minY - the minimum rotation around the Y axis (in radians)
      maxZ - the maximum rotation around the Z axis (in radians)
      minZ - the minimum rotation around the Z axis (in radians)
    • RangeOfMotion

      public RangeOfMotion(float maxX, float maxY, float maxZ)
      Instantiate a preset with the specified symmetric range of motion.
      Parameters:
      maxX - the maximum rotation around the X axis (in radians, ≥0)
      maxY - the maximum rotation around the Y axis (in radians, ≥0)
      maxZ - the maximum rotation around the Z axis (in radians, ≥0)
    • RangeOfMotion

      public RangeOfMotion(float maxAngle)
      Instantiate a preset with the specified symmetric range of motion.
      Parameters:
      maxAngle - the maximum rotation around each axis (in radians, ≥0)
    • RangeOfMotion

      public RangeOfMotion(int axisIndex)
      Instantiate a preset for rotation on a single axis.
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
  • Method Details

    • getMaxRotation

      public float getMaxRotation(int axisIndex)
      Read the maximum rotation around the indexed axis.
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      the rotation angle (in radians)
    • getMinRotation

      public float getMinRotation(int axisIndex)
      Read the minimum rotation around the indexed axis.
      Parameters:
      axisIndex - which axis: 0→X, 1→Y, 2→Z
      Returns:
      the rotation angle (in radians)
    • setupJoint

      public void setupJoint(SixDofJoint joint)
      Apply this preset to the specified joint.
      Parameters:
      joint - where to apply this preset (not null, modified)
    • read

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

      public void write(JmeExporter ex) throws IOException
      Serialize this preset, for example when saving to a J3O file.
      Specified by:
      write in interface Savable
      Parameters:
      ex - exporter (not null)
      Throws:
      IOException - from exporter