Package com.jme3.bullet.animation
Class LinkConfig
java.lang.Object
com.jme3.bullet.animation.LinkConfig
- All Implemented Interfaces:
com.jme3.export.Savable
,Comparable<LinkConfig>
Configuration data for a PhysicsLink, not including the bone name, attached
model, or RangeOfMotion. Immutable except for
read(com.jme3.export.JmeImporter)
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionInstantiate 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 TypeMethodDescriptionRead which centering heuristic to use.int
compareTo
(LinkConfig other) Compare with another LinkConfig object.boolean
Test for exact equivalence with another Object.int
hashCode()
Generate the hash code for this LinkConfig.float
mass()
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.
-
Field Details
-
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
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
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
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
Read the order in which axis rotations will be applied.- Returns:
- the enum value or null
-
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
Compare with another LinkConfig object.- Specified by:
compareTo
in interfaceComparable<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
De-serialize this configuration from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfacecom.jme3.export.Savable
- Parameters:
importer
- (not null)- Throws:
IOException
- from the importer
-
write
Serialize this configuration to the specified exporter, for example when saving to a J3O file.- Specified by:
write
in interfacecom.jme3.export.Savable
- Parameters:
exporter
- (not null)- Throws:
IOException
- from the exporter
-
equals
Test for exact equivalence with another Object. -
hashCode
public int hashCode()Generate the hash code for this LinkConfig.
-