@SuppressWarnings("unchecked") public void read(JMEImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); numObjects = capsule.readInt("numObjects", 0); Savable[] savs = capsule.readSavableArray("toChange", new Spatial[0]); if (savs == null) { toChange = null; } else { toChange = new Spatial[savs.length]; for (int x = 0; x < savs.length; x++) { toChange[x] = (Spatial) savs[x]; } } savs = capsule.readSavableArray("pivots", new TransformQuaternion[0]); if (savs == null) { pivots = null; } else { pivots = new TransformQuaternion[savs.length]; for (int x = 0; x < savs.length; x++) { pivots[x] = (TransformQuaternion) savs[x]; } } parentIndexes = capsule.readIntArray("parentIndexes", new int[0]); keyframes = capsule.readSavableArrayList("keyframes", new ArrayList()); haveChanged = capsule.readBooleanArray("haveChanged", new boolean[0]); beginPointTime = (PointInTime) capsule.readSavable("beginPointTime", null); endPointTime = (PointInTime) capsule.readSavable("endPointTime", null); }
/** * overridden by SpatialTransformer to always set a time inside the first and the last keyframe's * time in the animation * * @author Kai Rabien (hevee) */ public void setMaxTime(float maxTime) { if (keyframes != null && keyframes.size() > 0) { float firstFrame = keyframes.get(0).time; float lastFrame = keyframes.get(keyframes.size() - 1).time; if (maxTime < firstFrame) maxTime = firstFrame; if (maxTime > lastFrame) maxTime = lastFrame; } super.setMaxTime(maxTime); }
public void write(JMEExporter e) throws IOException { super.write(e); OutputCapsule capsule = e.getCapsule(this); capsule.write(mover, "mover", null); capsule.write(curve, "Curve", null); capsule.write(up, "up", null); capsule.write(orientationPrecision, "orientationPrecision", 0.1f); capsule.write(cycleForward, "cycleForward", true); capsule.write(autoRotation, "autoRotation", false); }
public void read(JMEImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); mover = (Spatial) capsule.readSavable("mover", null); curve = (Curve) capsule.readSavable("curve", null); up = (Vector3f) capsule.readSavable("up", null); orientationPrecision = capsule.readFloat("orientationPrecision", 0.1f); cycleForward = capsule.readBoolean("cycleForward", true); autoRotation = capsule.readBoolean("autoRotation", false); }
public void write(JMEExporter e) throws IOException { super.write(e); OutputCapsule capsule = e.getCapsule(this); capsule.write(numObjects, "numObjects", 0); capsule.write(toChange, "toChange", new Spatial[0]); capsule.write(pivots, "pivots", new TransformQuaternion[0]); capsule.write(parentIndexes, "parentIndexes", new int[0]); capsule.writeSavableArrayList(keyframes, "keyframes", new ArrayList()); capsule.write(haveChanged, "haveChanged", new boolean[0]); capsule.write(beginPointTime, "beginPointTime", null); capsule.write(endPointTime, "endPointTime", null); }
@Override public void write(JMEExporter e) throws IOException { super.write(e); OutputCapsule capsule = e.getCapsule(this); capsule.write(translationDelta, "translationDelta", null); capsule.write(rotationDelta, "rotationDelta", 0); capsule.write(textureRotationAxis, "textureRotationAxis", null); capsule.write(xRepeat, "xRepeat", 1); capsule.write(yRepeat, "yRepeat", 1); capsule.write(zRepeat, "zRepeat", 1); capsule.write(currentTranslation, "currentTranslation", null); capsule.write(currentRotation, "currentRotation", null); capsule.write(currentRotationAngle, "currentRotationAngle", 0); capsule.write(textures, "textures", null); }
@Override public void read(JMEImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); translationDelta = (Vector3f) capsule.readSavable("translationDelta", null); rotationDelta = capsule.readFloat("rotationDelta", 0); textureRotationAxis = (Vector3f) capsule.readSavable("textureRotationAxis", null); xRepeat = capsule.readFloat("xRepeat", 1); yRepeat = capsule.readFloat("yRepeat", 1); zRepeat = capsule.readFloat("zRepeat", 1); currentTranslation = (Vector3f) capsule.readSavable("currentTranslation", null); currentRotation = (Quaternion) capsule.readSavable("currentRotation", null); currentRotationAngle = capsule.readFloat("currentRotationAngle", 0); Savable[] savs = capsule.readSavableArray("textures", null); if (savs != null) { textures = new Texture[savs.length]; for (int i = 0; i < savs.length; i++) { textures[i] = (Texture) savs[i]; } } }