/** * Set the scales for this joint track * * @param scales the scales of the bone for each frame */ public void setKeyframesScale(Vector3f[] scales) { if (times == null) { throw new RuntimeException("TransformTrack doesn't have any time for key frames, please call setTimes first"); } if (scales.length == 0) { throw new RuntimeException("TransformTrack with no scale keyframes!"); } this.scales = new CompactVector3Array(); this.scales.add(scales); this.scales.freeze(); assert times != null && times.length == scales.length; }
@Override protected Vector3f deserialize(int i, Vector3f store) { int j = i*getTupleSize(); store.set(array[j], array[j+1], array[j+2]); return store; } }
@Override public void write(JmeExporter ex) throws IOException { serialize(); OutputCapsule out = ex.getCapsule(this); out.write(array, "array", null); out.write(index, "index", null); }
/** * returns the array of translations of this track * @return */ public Vector3f[] getTranslations() { return translations.toObjectArray(); }
rotations.get(0, tempQ); if (translations != null) translations.get(0, tempV); if (scales != null) { scales.get(0, tempS); rotations.get(lastFrame, tempQ); if (translations != null) translations.get(lastFrame, tempV); if (scales != null) { scales.get(lastFrame, tempS); rotations.get(startFrame, tempQ); if (translations != null) translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); translations.get(endFrame, tempV2); if (scales != null) { scales.get(endFrame, tempS2);
/** * returns the array of translations of this track * * @return */ public Vector3f[] getTranslations() { return translations.toObjectArray(); }
if (time < 0 || lastFrame == 0) { rotations.get(0, tempQ); translations.get(0, tempV); if (scales != null) { scales.get(0, tempS); translations.get(lastFrame, tempV); if (scales != null) { scales.get(lastFrame, tempS); translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); translations.get(endFrame, tempV2); if (scales != null) { scales.get(endFrame, tempS2);
/** * Set the translations for this joint track * * @param translations the translation of the bone for each frame */ public void setKeyframesTranslation(Vector3f[] translations) { if (times == null) { throw new RuntimeException("TransformTrack doesn't have any time for key frames, please call setTimes first"); } if (translations.length == 0) { throw new RuntimeException("TransformTrack with no translation keyframes!"); } this.translations = new CompactVector3Array(); this.translations.add(translations); this.translations.freeze(); assert times != null && times.length == translations.length; }
/** * returns the array of scales for this track * @return */ public Vector3f[] getScales() { return scales == null ? null : scales.toObjectArray(); }
@Override protected void serialize(int i, Vector3f store) { int j = i*getTupleSize(); array[j] = store.getX(); array[j+1] = store.getY(); array[j+2] = store.getZ(); }
@Override public void write(JmeExporter ex) throws IOException { serialize(); OutputCapsule out = ex.getCapsule(this); out.write(array, "array", null); out.write(index, "index", null); }
/** * Set the translations, rotations and scales for this bone track * * @param times the time of each frame, measured from the start of the track * (not null, length>0) * @param translations the translation of the bone for each frame (not null, * same length as times) * @param rotations the rotation of the bone for each frame (not null, same * length as times) * @param scales the scale of the bone for each frame (ignored if null) */ public void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales) { this.setKeyframes(times, translations, rotations); if (scales != null) { assert times.length == scales.length; this.scales = new CompactVector3Array(); this.scales.add(scales); this.scales.freeze(); } }
/** * @return the array of translations of this track */ public Vector3f[] getTranslations() { return translations == null ? null : translations.toObjectArray(); }
if (time < 0 || lastFrame == 0) { rotations.get(0, tempQ); translations.get(0, tempV); if (scales != null) { scales.get(0, tempS); translations.get(lastFrame, tempV); if (scales != null) { scales.get(lastFrame, tempS); translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); translations.get(endFrame, tempV2); if (scales != null) { scales.get(endFrame, tempS2);
@Override protected Vector3f deserialize(int i, Vector3f store) { int j = i*getTupleSize(); store.set(array[j], array[j+1], array[j+2]); return store; } }
@Override public void write(JmeExporter ex) throws IOException { serialize(); OutputCapsule out = ex.getCapsule(this); out.write(array, "array", null); out.write(index, "index", null); }
if (translations != null) { assert times.length == translations.length; this.translations = new CompactVector3Array(); this.translations.add(translations); this.translations.freeze(); this.scales = new CompactVector3Array(); this.scales.add(scales); this.scales.freeze();
/** * returns the array of scales for this track * * @return */ public Vector3f[] getScales() { return scales == null ? null : scales.toObjectArray(); }
if (time < 0 || lastFrame == 0) { rotations.get(0, tempQ); translations.get(0, tempV); if (scales != null) { scales.get(0, tempS); translations.get(lastFrame, tempV); if (scales != null) { scales.get(lastFrame, tempS); translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); translations.get(endFrame, tempV2); if (scales != null) { scales.get(endFrame, tempS2);