public void setKeyframesRotation(Quaternion[] rotations) {
        if (times == null) {
            throw new IllegalStateException(
                    "TransformTrack lacks keyframe times.  "
                    + "Please invoke setTimes() first.");
        }
        if (rotations == null || rotations.length == 0) {
            throw new IllegalArgumentException(
                    "No rotations were provided.");
        }
        this.rotations = new CompactQuaternionArray();
        this.rotations.add(rotations);
        this.rotations.freeze();

        assert times != null && times.length == rotations.length;
    }
Sets the rotations.

@param rotations the desired rotation of the target for each keyframe
    (not null, same length as "times")
jme3-core/src/main/java/com/jme3/anim/TransformTrack.java