use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class VehicleWheel method read.
@Override
public void read(JmeImporter im) throws IOException {
InputCapsule capsule = im.getCapsule(this);
wheelSpatial = (Spatial) capsule.readSavable("wheelSpatial", null);
frontWheel = capsule.readBoolean("frontWheel", false);
location = (Vector3f) capsule.readSavable("wheelLocation", new Vector3f());
direction = (Vector3f) capsule.readSavable("wheelDirection", new Vector3f());
axle = (Vector3f) capsule.readSavable("wheelAxle", new Vector3f());
suspensionStiffness = capsule.readFloat("suspensionStiffness", 20.0f);
wheelsDampingRelaxation = capsule.readFloat("wheelsDampingRelaxation", 2.3f);
wheelsDampingCompression = capsule.readFloat("wheelsDampingCompression", 4.4f);
frictionSlip = capsule.readFloat("frictionSlip", 10.5f);
rollInfluence = capsule.readFloat("rollInfluence", 1.0f);
maxSuspensionTravelCm = capsule.readFloat("maxSuspensionTravelCm", 500f);
maxSuspensionForce = capsule.readFloat("maxSuspensionForce", 6000f);
radius = capsule.readFloat("wheelRadius", 0.5f);
restLength = capsule.readFloat("restLength", 1f);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class AnimationEvent method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
if (im.getFormatVersion() == 0) {
modelName = ic.readString("modelName", "");
}
//FIXME always the same issue, because of the clonning of assets, this won't work
//we have to somehow store userdata in the spatial and then recurse the
//scene sub scenegraph to find the correct instance of the model
//This brings a reflaxion about the cinematic being an appstate,
//shouldn't it be a control over the scene
// this would allow to use the cloneForSpatial method and automatically
//rebind cloned references of original objects.
//for now as nobody probably ever saved a cinematic, this is not a critical issue
model = (Spatial) ic.readSavable("model", null);
animationName = ic.readString("animationName", "");
blendTime = ic.readFloat("blendTime", 0f);
channelIndex = ic.readInt("channelIndex", 0);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class SpatialTrack method read.
@Override
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
translations = (CompactVector3Array) ic.readSavable("translations", null);
rotations = (CompactQuaternionArray) ic.readSavable("rotations", null);
times = ic.readFloatArray("times", null);
scales = (CompactVector3Array) ic.readSavable("scales", null);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class TextureKey method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
flipY = ic.readBoolean("flip_y", false);
generateMips = ic.readBoolean("generate_mips", false);
anisotropy = ic.readInt("anisotropy", 0);
boolean asCube = ic.readBoolean("as_cubemap", false);
if (asCube) {
// Backwards compat
textureTypeHint = Type.CubeMap;
} else {
textureTypeHint = ic.readEnum("tex_type", Texture.Type.class, Type.TwoDimensional);
}
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class AudioKey method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
stream = ic.readBoolean("do_stream", false);
streamCache = ic.readBoolean("use_stream_cache", false);
}
Aggregations