Class RangeOfMotion

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

public class RangeOfMotion extends Object implements com.jme3.export.Savable
A range-of-motion preset for a ragdoll joint. 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 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.
    RangeOfMotion(com.jme3.math.Vector3f angles)
    Instantiate a preset with no motion allowed.
  • 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
    read(com.jme3.export.JmeImporter importer)
    De-serialize this preset from the specified importer, for example when loading from a J3O file.
    void
    setup(PhysicsJoint constraint, boolean lockX, boolean lockY, boolean lockZ)
    Apply this preset to the specified constraint, locking the specified rotational axes at their current angles.
    void
    setupJoint(SixDofJoint joint, boolean lockX, boolean lockY, boolean lockZ)
    Apply this preset to the specified joint, locking the specified rotational axes at their current angles.
    void
    setupNew6Dof(New6Dof constraint, boolean lockX, boolean lockY, boolean lockZ)
    Apply this preset to the specified constraint, locking the specified rotational axes at their current angles.
    void
    write(com.jme3.export.JmeExporter exporter)
    Serialize this preset to the specified exporter, 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(com.jme3.math.Vector3f angles)
      Instantiate a preset with no motion allowed.
      Parameters:
      angles - the desired Euler rotation angles (not null, unaffected)
    • 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)
    • setup

      public void setup(PhysicsJoint constraint, boolean lockX, boolean lockY, boolean lockZ)
      Apply this preset to the specified constraint, locking the specified rotational axes at their current angles.
      Parameters:
      constraint - where to apply this preset (not null, modified)
      lockX - true→prevent the joint from rotating around its local X axis
      lockY - true→prevent the joint from rotating around its local Y axis
      lockZ - true→prevent the joint from rotating around its local Z axis
    • setupJoint

      public void setupJoint(SixDofJoint joint, boolean lockX, boolean lockY, boolean lockZ)
      Apply this preset to the specified joint, locking the specified rotational axes at their current angles.
      Parameters:
      joint - where to apply this preset (not null, modified)
      lockX - true→prevent the joint from rotating around its local X axis
      lockY - true→prevent the joint from rotating around its local Y axis
      lockZ - true→prevent the joint from rotating around its local Z axis
    • setupNew6Dof

      public void setupNew6Dof(New6Dof constraint, boolean lockX, boolean lockY, boolean lockZ)
      Apply this preset to the specified constraint, locking the specified rotational axes at their current angles.
      Parameters:
      constraint - where to apply this preset (not null, modified)
      lockX - true→prevent the joint from rotating around its local X axis
      lockY - true→prevent the joint from rotating around its local Y axis
      lockZ - true→prevent the joint from rotating around its local Z axis
    • read

      public void read(com.jme3.export.JmeImporter importer) throws IOException
      De-serialize this preset 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 preset 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