/** * Set the weight for this morph track * * @param times a float array with the time of each frame * @param weights the weights of the morphs for each frame */ public void setKeyframes(float[] times, float[] weights) { setTimes(times); if (weights != null) { if (times == null) { throw new RuntimeException("MorphTrack doesn't have any time for key frames, please call setTimes first"); } this.weights = weights; assert times != null && times.length == weights.length; } }
@Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); weights = ic.readFloatArray("weights", null); times = ic.readFloatArray("times", null); target = (Geometry) ic.readSavable("target", null); nbMorphTargets = ic.readInt("nbMorphTargets", 0); setTimes(times); }