/** * Set the rotations for this joint track * * @param rotations the rotations of the bone for each frame */ public void setKeyframesRotation(Quaternion[] rotations) { if (times == null) { throw new RuntimeException("TransformTrack doesn't have any time for key frames, please call setTimes first"); } if (rotations.length == 0) { throw new RuntimeException("TransformTrack with no rotation keyframes!"); } this.rotations = new CompactQuaternionArray(); this.rotations.add(rotations); this.rotations.freeze(); assert times != null && times.length == rotations.length; }
@Override protected Quaternion deserialize(int i, Quaternion store) { int j = i * getTupleSize(); store.set(array[j], array[j + 1], array[j + 2], array[j + 3]); 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); }
/** * return the array of rotations of this track * @return */ public Quaternion[] getRotations() { return rotations.toObjectArray(); }
rotations.get(0, tempQ); translations.get(0, tempV); if (scales != null) { rotations.get(lastFrame, tempQ); translations.get(lastFrame, tempV); if (scales != null) { / (times[endFrame] - times[startFrame]); rotations.get(startFrame, tempQ); translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); rotations.get(endFrame, tempQ2); translations.get(endFrame, tempV2); if (scales != null) {
/** * return the array of rotations of this track * * @return */ public Quaternion[] getRotations() { return rotations.toObjectArray(); }
if (time < 0 || lastFrame == 0) { if (rotations != null) rotations.get(0, tempQ); if (translations != null) translations.get(0, tempV); rotations.get(lastFrame, tempQ); if (translations != null) translations.get(lastFrame, tempV); rotations.get(startFrame, tempQ); if (translations != null) translations.get(startFrame, tempV); rotations.get(endFrame, tempQ2); if (translations != null) translations.get(endFrame, tempV2);
/** * Set the translations and rotations 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) */ public void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] rotations) { if (times.length == 0) { throw new RuntimeException("BoneTrack with no keyframes!"); } assert translations != null; assert times.length == translations.length; assert rotations != null; assert times.length == rotations.length; this.times = times; this.translations = new CompactVector3Array(); this.translations.add(translations); this.translations.freeze(); this.rotations = new CompactQuaternionArray(); this.rotations.add(rotations); this.rotations.freeze(); }
/** * @return the array of rotations of this track */ public Quaternion[] getRotations() { return rotations == null ? null : rotations.toObjectArray(); }
rotations.get(0, transform.getRotation());
@Override protected void serialize(int i, Quaternion store) { int j = i * getTupleSize(); array[j] = store.getX(); array[j + 1] = store.getY(); array[j + 2] = store.getZ(); array[j + 3] = store.getW(); }
@Override public void write(JmeExporter ex) throws IOException { serialize(); OutputCapsule out = ex.getCapsule(this); out.write(array, "array", null); out.write(index, "index", null); }
this.rotations = new CompactQuaternionArray(); this.rotations.add(rotations); this.rotations.freeze();
/** * return the array of rotations of this track * @return */ public Quaternion[] getRotations() { return rotations.toObjectArray(); }
rotations.get(0, tempQ); translations.get(0, tempV); if (scales != null) { rotations.get(lastFrame, tempQ); translations.get(lastFrame, tempV); if (scales != null) { / (times[endFrame] - times[startFrame]); rotations.get(startFrame, tempQ); translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); rotations.get(endFrame, tempQ2); translations.get(endFrame, tempV2); if (scales != null) {
@Override protected Quaternion deserialize(int i, Quaternion store) { int j = i * getTupleSize(); store.set(array[j], array[j + 1], array[j + 2], array[j + 3]); 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); }
Savable[] sav = ic.readSavableArray("rotations", null); if (sav != null) { rotations = new CompactQuaternionArray(); Quaternion[] rotCopy = new Quaternion[sav.length]; System.arraycopy(sav, 0, rotCopy, 0, sav.length); rotations.add(rotCopy); rotations.freeze();
/** * @return the array of rotations of this track */ public Quaternion[] getRotations() { return rotations == null ? null : rotations.toObjectArray(); }
rotations.get(0, tempQ); translations.get(0, tempV); if (scales != null) { rotations.get(lastFrame, tempQ); translations.get(lastFrame, tempV); if (scales != null) { / (times[endFrame] - times[startFrame]); rotations.get(startFrame, tempQ); translations.get(startFrame, tempV); if (scales != null) { scales.get(startFrame, tempS); rotations.get(endFrame, tempQ2); translations.get(endFrame, tempV2); if (scales != null) {