Search in sources :

Example 1 with FbxAnimCurve

use of com.jme3.scene.plugins.fbx.objects.FbxAnimCurve in project jmonkeyengine by jMonkeyEngine.

the class SceneLoader method loadObjects.

private void loadObjects(FbxElement element) throws IOException {
    FbxObject obj = null;
    for (FbxElement e : element.children) {
        switch(e.id) {
            case "Geometry":
                FbxMesh mesh = new FbxMesh(this, e);
                obj = mesh;
                if (mesh.geometries != null)
                    geomMap.put(mesh.id, mesh);
                break;
            case "Material":
                obj = new FbxMaterial(this, e);
                break;
            case "Model":
                FbxNode node = new FbxNode(this, e);
                obj = node;
                modelMap.put(node.id, node);
                if (node.isLimb())
                    limbMap.put(node.id, node);
                break;
            case "Pose":
                FbxBindPose pose = new FbxBindPose(this, e);
                obj = pose;
                bindMap.put(pose.id, pose);
                break;
            case "Texture":
                obj = new FbxTexture(this, e);
                break;
            case "Video":
                obj = new FbxImage(this, e);
                break;
            case "Deformer":
                obj = loadDeformer(e);
                break;
            case "AnimationLayer":
                FbxObject layer = new FbxObject(this, e);
                obj = layer;
                alayerMap.put(layer.id, layer);
                break;
            case "AnimationCurve":
                obj = new FbxAnimCurve(this, e);
                break;
            case "AnimationCurveNode":
                obj = new FbxAnimNode(this, e);
                break;
            default:
                obj = null;
        }
        if (obj != null)
            allObjects.put(obj.id, obj);
    }
}
Also used : FbxElement(com.jme3.scene.plugins.fbx.file.FbxElement) FbxObject(com.jme3.scene.plugins.fbx.objects.FbxObject) FbxNode(com.jme3.scene.plugins.fbx.objects.FbxNode) FbxAnimCurve(com.jme3.scene.plugins.fbx.objects.FbxAnimCurve) FbxTexture(com.jme3.scene.plugins.fbx.objects.FbxTexture) FbxMesh(com.jme3.scene.plugins.fbx.objects.FbxMesh) FbxBindPose(com.jme3.scene.plugins.fbx.objects.FbxBindPose) FbxAnimNode(com.jme3.scene.plugins.fbx.objects.FbxAnimNode) FbxMaterial(com.jme3.scene.plugins.fbx.objects.FbxMaterial) FbxImage(com.jme3.scene.plugins.fbx.objects.FbxImage)

Example 2 with FbxAnimCurve

use of com.jme3.scene.plugins.fbx.objects.FbxAnimCurve in project jmonkeyengine by jMonkeyEngine.

the class FbxAnimCurveNode method getVector3Value.

public Vector3f getVector3Value(long time) {
    Vector3f value = new Vector3f();
    FbxAnimCurve xCurve = propertyToCurveMap.get(FbxAnimUtil.CURVE_NODE_PROPERTY_X);
    FbxAnimCurve yCurve = propertyToCurveMap.get(FbxAnimUtil.CURVE_NODE_PROPERTY_Y);
    FbxAnimCurve zCurve = propertyToCurveMap.get(FbxAnimUtil.CURVE_NODE_PROPERTY_Z);
    Float xDefault = propertyToDefaultMap.get(FbxAnimUtil.CURVE_NODE_PROPERTY_X);
    Float yDefault = propertyToDefaultMap.get(FbxAnimUtil.CURVE_NODE_PROPERTY_Y);
    Float zDefault = propertyToDefaultMap.get(FbxAnimUtil.CURVE_NODE_PROPERTY_Z);
    value.x = xCurve != null ? xCurve.getValueAtTime(time) : xDefault;
    value.y = yCurve != null ? yCurve.getValueAtTime(time) : yDefault;
    value.z = zCurve != null ? zCurve.getValueAtTime(time) : zDefault;
    return value;
}
Also used : Vector3f(com.jme3.math.Vector3f)

Aggregations

Vector3f (com.jme3.math.Vector3f)1 FbxElement (com.jme3.scene.plugins.fbx.file.FbxElement)1 FbxAnimCurve (com.jme3.scene.plugins.fbx.objects.FbxAnimCurve)1 FbxAnimNode (com.jme3.scene.plugins.fbx.objects.FbxAnimNode)1 FbxBindPose (com.jme3.scene.plugins.fbx.objects.FbxBindPose)1 FbxImage (com.jme3.scene.plugins.fbx.objects.FbxImage)1 FbxMaterial (com.jme3.scene.plugins.fbx.objects.FbxMaterial)1 FbxMesh (com.jme3.scene.plugins.fbx.objects.FbxMesh)1 FbxNode (com.jme3.scene.plugins.fbx.objects.FbxNode)1 FbxObject (com.jme3.scene.plugins.fbx.objects.FbxObject)1 FbxTexture (com.jme3.scene.plugins.fbx.objects.FbxTexture)1