use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class GhostControl method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
enabled = ic.readBoolean("enabled", true);
spatial = (Spatial) ic.readSavable("spatial", null);
applyLocal = ic.readBoolean("applyLocalPhysics", false);
setUserObject(spatial);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class RigidBodyControl method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
enabled = ic.readBoolean("enabled", true);
kinematicSpatial = ic.readBoolean("kinematicSpatial", true);
spatial = (Spatial) ic.readSavable("spatial", null);
motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
setUserObject(spatial);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class VehicleControl method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
enabled = ic.readBoolean("enabled", true);
spatial = (Spatial) ic.readSavable("spatial", null);
motionState.setApplyPhysicsLocal(ic.readBoolean("applyLocalPhysics", false));
setUserObject(spatial);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class TrackInfo method read.
public void read(JmeImporter im) throws IOException {
InputCapsule c = im.getCapsule(this);
tracks = c.readSavableArrayList("tracks", null);
}
use of com.jme3.export.InputCapsule in project jmonkeyengine by jMonkeyEngine.
the class AudioNode method read.
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
// to "audio_key" in case Spatial's key will be written as "key".
if (ic.getSavableVersion(AudioNode.class) == 0) {
audioKey = (AudioKey) ic.readSavable("key", null);
} else {
audioKey = (AudioKey) ic.readSavable("audio_key", null);
}
loop = ic.readBoolean("looping", false);
volume = ic.readFloat("volume", 1);
pitch = ic.readFloat("pitch", 1);
timeOffset = ic.readFloat("time_offset", 0);
dryFilter = (Filter) ic.readSavable("dry_filter", null);
velocity = (Vector3f) ic.readSavable("velocity", null);
reverbEnabled = ic.readBoolean("reverb_enabled", false);
reverbFilter = (Filter) ic.readSavable("reverb_filter", null);
maxDistance = ic.readFloat("max_distance", 20);
refDistance = ic.readFloat("ref_distance", 10);
directional = ic.readBoolean("directional", false);
direction = (Vector3f) ic.readSavable("direction", null);
innerAngle = ic.readFloat("inner_angle", 360);
outerAngle = ic.readFloat("outer_angle", 360);
positional = ic.readBoolean("positional", false);
velocityFromTranslation = ic.readBoolean("velocity_from_translation", false);
if (audioKey != null) {
try {
data = im.getAssetManager().loadAsset(audioKey);
} catch (AssetNotFoundException ex) {
Logger.getLogger(AudioNode.class.getName()).log(Level.FINE, "Cannot locate {0} for audio node {1}", new Object[] { audioKey, key });
data = PlaceholderAssets.getPlaceholderAudio();
}
}
}
Aggregations