Package com.jme3.bullet.animation
Class RangeOfMotion
java.lang.Object
com.jme3.bullet.animation.RangeOfMotion
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionInstantiate 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 TypeMethodDescriptionfloatgetMaxRotation(int axisIndex) Read the maximum rotation around the indexed axis.floatgetMinRotation(int axisIndex) Read the minimum rotation around the indexed axis.voidread(JmeImporter im) De-serialize this preset, for example when loading from a J3O file.voidsetupJoint(SixDofJoint joint) Apply this preset to the specified joint.voidwrite(JmeExporter ex) Serialize this preset, for example when saving to a J3O file.
-
Field Details
-
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
Apply this preset to the specified joint.- Parameters:
joint- where to apply this preset (not null, modified)
-
read
De-serialize this preset, for example when loading from a J3O file.- Specified by:
readin interfaceSavable- Parameters:
im- importer (not null)- Throws:
IOException- from importer
-
write
Serialize this preset, for example when saving to a J3O file.- Specified by:
writein interfaceSavable- Parameters:
ex- exporter (not null)- Throws:
IOException- from exporter
-