/** * Returns the track as a spatial track. * * @return the spatial track */ public SpatialTrack getAsSpatialTrack() { if (translations == null && rotations == null && scales == null) { return null; } return new SpatialTrack(this.createTimes(), translations.toArray(new Vector3f[maxFrame]), rotations.toArray(new Quaternion[maxFrame]), scales.toArray(new Vector3f[maxFrame])); }
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
return new SpatialTrack(times, translations, rotations, scales); } else { if (scales != null) {
calculatedTrack = new SpatialTrack(times, translations, rotations, scales); } else { calculatedTrack = new BoneTrack(targetIndex, times, translations, rotations, scales);
scales[i] = Vector3f.UNIT_XYZ; SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales);
/** * This method creates a clone of the current object. * @return a clone of the current object */ @Override public SpatialTrack clone() { int tablesLength = times.length; float[] timesCopy = this.times.clone(); Vector3f[] translationsCopy = this.getTranslations() == null ? null : Arrays.copyOf(this.getTranslations(), tablesLength); Quaternion[] rotationsCopy = this.getRotations() == null ? null : Arrays.copyOf(this.getRotations(), tablesLength); Vector3f[] scalesCopy = this.getScales() == null ? null : Arrays.copyOf(this.getScales(), tablesLength); //need to use the constructor here because of the final fields used in this class return new SpatialTrack(timesCopy, translationsCopy, rotationsCopy, scalesCopy); }
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
return new SpatialTrack(times, translations, rotations, scales); } else { if (scales != null) {
Spatial s = (Spatial) node; spatials.add(s); SpatialTrack track = new SpatialTrack(trackData.times, trackData.translations, trackData.rotations, trackData.scales); track.setTrackSpatial(s); anim.addTrack(track);