private Vector3f interpolateScale(float keyFrameTime) {
        assert keyFrameTime >= 0f && keyFrameTime <= duration;

        float prev = 0f;
        float next = duration;
        for (float key : scales.keySet()) {
            if (key <= keyFrameTime && key > prev) {
                prev = key;
            }
            if (key >= keyFrameTime && key < next) {
                next = key;
            }
        }
        assert prev <= next;
        Vector3f prevScale = scales.get(prev);

        Vector3f result = new Vector3f();
        if (prev == next || !scales.containsKey(next)) {
            result.set(prevScale);

        } else { // interpolate
            float fraction = (keyFrameTime - prev) / (next - prev);
            assert fraction >= 0f && fraction <= 1f;
            Vector3f nextScale = scales.get(next);
            result.interpolateLocal(prevScale, nextScale, fraction);
        }

        return result;
    }
Interpolate successive scale keyframes for the specified time.

@param keyFrameTime the animation time (in seconds, &ge;0)
@return a new instance
jme3-core/src/main/java/com/jme3/anim/AnimFactory.java