/** * This method creates a clone of the current object. * @return a clone of the current object */ @Override public BoneTrack clone() { int tablesLength = times.length; float[] times = this.times.clone(); Vector3f[] sourceTranslations = this.getTranslations(); Quaternion[] sourceRotations = this.getRotations(); Vector3f[] sourceScales = this.getScales(); Vector3f[] translations = new Vector3f[tablesLength]; Quaternion[] rotations = new Quaternion[tablesLength]; Vector3f[] scales = new Vector3f[tablesLength]; for (int i = 0; i < tablesLength; ++i) { translations[i] = sourceTranslations[i].clone(); rotations[i] = sourceRotations[i].clone(); scales[i] = sourceScales != null ? sourceScales[i].clone() : new Vector3f(1.0f, 1.0f, 1.0f); } // Need to use the constructor here because of the final fields used in this class return new BoneTrack(targetBoneIndex, times, translations, rotations, scales); }