Package com.jme3.scene.plugins.bvh
Class SkeletonMapping
java.lang.Object
com.jme3.scene.plugins.bvh.SkeletonMapping
- All Implemented Interfaces:
com.jme3.export.Savable,Cloneable
Data used to map poses from one skeleton to another: a collection of bone
mappings.
-
Constructor Summary
ConstructorsConstructorDescriptionA no-arg constructor to avoid javadoc warnings from JDK 18. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMapping(BoneMapping mapping) Add a bone mapping to this skeleton mapping.voidclear()Empty this skeleton mapping.clone()Create a deep copy of this mapping.intCount the number of bone mappings in this skeleton mapping.Find the bone mapping for the named target bone.getForSource(String sourceBoneName) Find the bone mapping for the named source bone.inverse()Generate an inverse for this mapping.Enumerate all source bones in this mapping.Enumerate all target bones in this mapping.Builds a BoneMapping with the given bone from the target skeleton and the given bone from the source skeleton.Add a mapping from the named bone in the target skeleton to the named bone in the source skeleton, applying the specified twist.Add a mapping from the named bone in the target skeleton to the named bone in the source skeleton, applying the specified twist.voidread(com.jme3.export.JmeImporter im) De-serialize this mapping.voidremoveMapping(BoneMapping mapping) Remove a bone mapping from this skeleton mapping.voidrenameSourceBone(String oldName, String newName) Update this mapping after a source bone is renamed.voidrenameTargetBone(String oldName, String newName) Update this mapping after a target bone is renamed.voidwrite(com.jme3.export.JmeExporter ex) Serialize this instance.
-
Constructor Details
-
SkeletonMapping
public SkeletonMapping()A no-arg constructor to avoid javadoc warnings from JDK 18.
-
-
Method Details
-
addMapping
Add a bone mapping to this skeleton mapping.- Parameters:
mapping- bone mapping (not null)
-
clear
public void clear()Empty this skeleton mapping. -
countMappings
public int countMappings()Count the number of bone mappings in this skeleton mapping.- Returns:
- count (≥0)
-
get
Find the bone mapping for the named target bone.- Parameters:
targetBoneName- which target bone- Returns:
- the pre-existing instance, or null if none found
-
getForSource
Find the bone mapping for the named source bone.- Parameters:
sourceBoneName- which source bone- Returns:
- the pre-existing instance, or null if none found
-
inverse
Generate an inverse for this mapping.- Returns:
- a new mapping
-
listSourceBones
Enumerate all source bones in this mapping.- Returns:
- a new list of names
-
listTargetBones
Enumerate all target bones in this mapping.- Returns:
- a new list of names
-
map
Builds a BoneMapping with the given bone from the target skeleton and the given bone from the source skeleton.- Parameters:
targetBone- the name of the bone from the target skeleton.sourceBone- the name of the bone from the source skeleton.- Returns:
- a new instance
-
map
Add a mapping from the named bone in the target skeleton to the named bone in the source skeleton, applying the specified twist.- Parameters:
targetName- name of bone in the target skeletonsourceName- name of bone in the source skeletontwist- twist rotation to apply to the animation data- Returns:
- a new instance
-
map
public BoneMapping map(String targetBone, String sourceBone, float twistAngle, com.jme3.math.Vector3f twistAxis) Add a mapping from the named bone in the target skeleton to the named bone in the source skeleton, applying the specified twist.- Parameters:
targetBone- name of bone in the target skeletonsourceBone- name of bone in the source skeletontwistAngle- twist rotation angletwistAxis- twist rotation axis- Returns:
- a new instance
-
removeMapping
Remove a bone mapping from this skeleton mapping.- Parameters:
mapping- bone mapping (not null)
-
renameSourceBone
Update this mapping after a source bone is renamed.- Parameters:
oldName- old name of bonenewName- new name for bone
-
renameTargetBone
Update this mapping after a target bone is renamed.- Parameters:
oldName- old name of bonenewName- new name for bone
-
clone
Create a deep copy of this mapping.- Overrides:
clonein classObject- Returns:
- a new mapping, equivalent to this one
- Throws:
CloneNotSupportedException- if superclass isn't cloneable
-
read
De-serialize this mapping.- Specified by:
readin interfacecom.jme3.export.Savable- Parameters:
im- importer to use (not null)- Throws:
IOException- from importer
-
write
Serialize this instance.- Specified by:
writein interfacecom.jme3.export.Savable- Parameters:
ex- exporter to use (not null)- Throws:
IOException- from exporter
-