use of com.jme3.scene.plugins.fbx.objects.FbxSkin in project jmonkeyengine by jMonkeyEngine.
the class SceneLoader method loadDeformer.
private FbxObject loadDeformer(FbxElement element) {
String type = (String) element.properties.get(2);
switch(type) {
case "Skin":
FbxSkin skinData = new FbxSkin(this, element);
skinMap.put(skinData.id, skinData);
return skinData;
case "Cluster":
FbxCluster clusterData = new FbxCluster(this, element);
return clusterData;
}
return null;
}
use of com.jme3.scene.plugins.fbx.objects.FbxSkin in project jmonkeyengine by jMonkeyEngine.
the class SceneLoader method applySkinning.
private void applySkinning() {
for (FbxBindPose pose : bindMap.values()) pose.fillBindTransforms();
if (limbMap == null)
return;
List<Bone> bones = new ArrayList<>();
for (FbxNode limb : limbMap.values()) {
if (limb.bone != null) {
bones.add(limb.bone);
limb.buildBindPoseBoneTransform();
}
}
skeleton = new Skeleton(bones.toArray(new Bone[bones.size()]));
skeleton.setBindingPose();
for (FbxNode limb : limbMap.values()) limb.setSkeleton(skeleton);
for (FbxSkin skin : skinMap.values()) skin.generateSkinning();
// Attach controls
animControl = new AnimControl(skeleton);
sceneNode.addControl(animControl);
SkeletonControl control = new SkeletonControl(skeleton);
sceneNode.addControl(control);
}
Aggregations